Obfuscate your python script by converting it to emoji icons
Project description
emojify :) ๐
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 emojify
If installation fails with pip
for some reason, you can just clone the repository, since there are no dependancies apart from python 3:
git clone https://github.com/chris-rands/emojify
cd emojify
Usage
emojify --input input_script.py --output output_script.py
For help:
emojify --help
For unit testing:
test_emojify
Example
input_script.py
contains:
print('hello world')
def add(n1,n2):
return n1 + n2
print('4 + 4 = {}'.format(add(4,4)))
running emojify --input input_script.py --output output_script.py
output_script.py
contains:
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 emojify --input input_script.py --output output_script.py --emoji
output_script.py
contains:
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.6+ 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file emojify-0.5.tar.gz
.
File metadata
- Download URL: emojify-0.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b60ec59bcec8c57fa61046231555b44007ad30fb3e82c5695f70d92cf5bbf93 |
|
MD5 | 8cf91eca01a4266ab5890fb1f4186192 |
|
BLAKE2b-256 | 143c1decc4fe6e7c12a543333d37f89a078ac695e3aabf8c9e00fb117b8f8c11 |
File details
Details for the file emojify-0.5-py3-none-any.whl
.
File metadata
- Download URL: emojify-0.5-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683aefaf6c32d27c578482dee3a62735ccbef056e734806ebd0a7748cded8545 |
|
MD5 | 8c171fc46bb986d4e0578cd219b2ec42 |
|
BLAKE2b-256 | ae86b359c920c33a034108ff923b3d99e35f6c4d8b3b32a518b6bfc0f89ac148 |