GithubHelp home page GithubHelp logo

sandy4321 / emojify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chris-rands/emojify

0.0 0.0 0.0 43 KB

Obfuscate your python script by converting it to emoji icons

License: MIT License

Python 100.00%

emojify's Introduction

PyPI version License: MIT Code style: black

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.

emojify's People

Contributors

chris-rands avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.