Skip to main content

salamemojify :) 😊

Description

Obfuscate your python script (or indeed any plain text file) by converting an input script to an output script that functions the same (hopefully) but encodes the code as emoji icons, currently emoticons or emojis.

Installation

pip install salamemojify

If installation fails with pip for some reason, you can just clone the repository, since there are no dependancies apart from python 3:

Usage

salamemojify --input input_script.py --output output_script.py

For help: salamemojify --help

For unit testing: test_salamemojify

Example

input_script.py contains:

print('hello world')
def add(n1,n2):
    return n1 + n2
print('4 + 4 = {}'.format(add(4,4)))

running salamemojify --input input_script.py --output output_script.py

output_script.py contains: from salamemojify import * exec("".join(map(chr,[int("".join(str({':(': 4, ':)': 0, ':/': 7, ':D': 1, ':P': 2, ':S': 3, ':{': 8, ';)': 9, '=)': 5, '=/': 6}[i]) for i in x.split())) for x in ":D :D :P :D :D :( :D :) =) :D :D :) :D :D =/ :( :) :S ;) :D :)
:( :D :) :D :D :) :{ :D :) :{ :D :D :D :S :P :D :D ;) :D :D :D
:D :D :( :D :) :{ :D :) :) :S ;) :( :D :D :) :D :) :) :D :) :D
:D :) :P :S :P ;) :/ :D :) :) :D :) :) :( :) :D :D :) :( ;)
:( :( :D :D :) =) :) :( :D =) :{ :D :) :S :P :S :P :S :P :S :
P :D :D :( :D :) :D :D :D =/ :D :D :/ :D :D :( :D :D :) :S :P
:D :D :) :( ;) :S :P :( :S :S :P :D :D :) =) :) :D :) :D :D :P
:D :D :( :D :) =) :D :D :) :D :D =/ :( :) :S ;) =) :P :S :P
:( :S :S :P =) :P :S :P =/ :D :S :P :D :P :S :D :P =) :S ;) :
( =/ :D :) :P :D :D :D :D :D :( :D :) ;) ;) :/ :D :D =/ :( :)
;) :/ :D :) :) :D :) :) :( :) =) :P :( :( =) :P :( :D :( :D :
( :D :D :)" .split(" ")])))

running python output_script.py outputs:

hello world
4 + 4 = 8

similarly, running salamemojify --input input_script.py --output output_script.py --emoji

output_script.py contains: from salamemojify import * exec("".join(map(chr,[int("".join(str({'😀': 0, '😁': 3, '😂': 6, '😃': 1, '😄': 2, '😅': 4, '😉': 7, '😊': 8, '😛': 9, '🤣': 5}[i]) for i in x.split())) for x in "😃 😃 😄 😃 😃 😅 😃 😀 🤣 😃 😃 😀 😃 😃 😂 😅 😀 😁 😛 😃 😀 😅 😃 😀 😃 😃 😀 😊 😃 😀
😊 😃 😃 😃 😁 😄 😃 😃 😛 😃 😃 😃 😃 😃 😅 😃 😀 😊 😃 😀 😀 😁 😛 😅 😃 😃 😀 😃 😀 😀
😃 😀 😃 😃 😀 😄 😁 😄 😛 😉 😃 😀 😀 😃 😀 😀 😅 😀 😃 😃 😀 😅 😛 😅 😅 😃 😃 😀 🤣
😀 😅 😃 🤣 😊 😃 😀 😁 😄 😁 😄 😁 😄 😁 😄 😃 😃 😅 😃 😀 😃 😃 😃 😂 😃 😃 😉 😃 😃
😅 😃 😃 😀 😁 😄 😃 😃 😀 😅 😛 😁 😄 😅 😁 😁 😄 😃 😃 😀 🤣 😀 😃 😀 😃 😃 😄 😃 😃
😅 😃 😀 🤣 😃 😃 😀 😃 😃 😂 😅 😀 😁 😛 🤣 😄 😁 😄 😅 😁 😁 😄 🤣 😄 😁 😄 😂 😃
😁 😄 😃 😄 😁 😃 😄 🤣 😁 😛 😅 😂 😃 😀 😄 😃 😃 😃 😃 😃 😅 😃 😀 😛 😛 😉 😃 😃 😂 😅
😀 😛 😉 😃 😀 😀 😃 😀 😀 😅 😀 🤣 😄 😅 😅 🤣 😄 😅 😃 😅 😃 😅 😃 😃 😀" .split(" ")])))

and running output_script.py ouputs the same as above.

Disclaimer

Only tested on Python 3+ and on CPython. Not tested on complex scripts, so don't rely on this script to work, not guaranteed to work at all, and it is probably easy to break. One case it will fail is with non-unicode characters. Also note, if you want to securely protect your code from the eyes of others, this is NOT a good way.

Release files for salamemojify 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for salamemojify 1.0.0
File Size Uploaded
salamemojify-1.0.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for salamemojify 1.0.0
File Interpreter ABI Platform
salamemojify-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / salamemojify-1.0.0.tar.gz

Download URL salamemojify-1.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
efa2306731552697ad220bb813ba97794fcfa5b4a6c0529327ff810107dd2740
BLAKE2b-256 checksum
How to use checksums
7a80cddebb4aeb8fd9f5f57e4ed2ed4541ec4b1cece3372fdf91c8bd8bbb7a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

Release files / salamemojify-1.0.0-py3-none-any.whl

Download URL salamemojify-1.0.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90c5ecc03299ee8cfd85e0d7ef1f6afa715854a88c14be0b77867b1d0125e648
BLAKE2b-256 checksum
How to use checksums
7a32b4c2c0d67cc93973097d93e35e370cc65a31b1796abdb7003677f125b6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page