Skip to main content

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

emojify-0.5.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

emojify-0.5-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

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

Hashes for emojify-0.5.tar.gz
Algorithm Hash digest
SHA256 6b60ec59bcec8c57fa61046231555b44007ad30fb3e82c5695f70d92cf5bbf93
MD5 8cf91eca01a4266ab5890fb1f4186192
BLAKE2b-256 143c1decc4fe6e7c12a543333d37f89a078ac695e3aabf8c9e00fb117b8f8c11

See more details on using hashes here.

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

Hashes for emojify-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 683aefaf6c32d27c578482dee3a62735ccbef056e734806ebd0a7748cded8545
MD5 8c171fc46bb986d4e0578cd219b2ec42
BLAKE2b-256 ae86b359c920c33a034108ff923b3d99e35f6c4d8b3b32a518b6bfc0f89ac148

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page