Obfuscate your python script by converting it to emoji icons
Project description
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.
Project details
Release history Release notifications | RSS feed
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 salamemojify-1.0.0.tar.gz
.
File metadata
- Download URL: salamemojify-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efa2306731552697ad220bb813ba97794fcfa5b4a6c0529327ff810107dd2740 |
|
MD5 | a858ea2436b1c77d2222eb14cff48a75 |
|
BLAKE2b-256 | 7a80cddebb4aeb8fd9f5f57e4ed2ed4541ec4b1cece3372fdf91c8bd8bbb7a62 |
File details
Details for the file salamemojify-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: salamemojify-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90c5ecc03299ee8cfd85e0d7ef1f6afa715854a88c14be0b77867b1d0125e648 |
|
MD5 | 0a20b5dac4836d587652eeeeb3898ab0 |
|
BLAKE2b-256 | 7a32b4c2c0d67cc93973097d93e35e370cc65a31b1796abdb7003677f125b6f5 |