Package: obfuscatron
ObfuscatronEncrypt data by storing it within a Python script that pretends to just be
"obfuscated"FeaturesStore binary or text data within the identifiers of a Python scriptObfuscated Python script can be executed (see notes below)Currently, Obfuscatron is able to store data within the following Python syntax:VariablesClass NamesFunction NamesType Hint IdentifiersInstallation$pipinstallobfuscatron
$pipinstall"git+https://github.com/Pebaz/obfuscatron"Usage$obfuscatronFILE.pyencodeDATAFILEOUTFILE.py
$obfuscatronOUTFILE.pydecodeDATAFILEExampleGiven this Python file to store some data:custom_int_name=intdeffunction_add(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number+second_numberdeffunction_sub(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number-second_numberdeffunction_mul(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number*second_numberdeffunction_div(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number/second_numberdeffunction_mod(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number%second_numberdeffunction_exp(first_number:custom_int_name,second_number:custom_int_name):returnfirst_number**second_numbercustom_float_name=floatdeffunc_float_add(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num+second_numdeffunc_float_sub(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num-second_numdeffunc_float_mul(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num*second_numdeffunc_float_div(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num/second_numdeffunc_float_mod(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num%second_numdeffunc_float_exp(first_num:custom_float_name,second_num:custom_float_name):returnfirst_num**second_numcustom_bool_name=booldeffunction_and(first_bool:custom_bool_name,second_bool:custom_bool_name):returnfirst_boolandsecond_booldeffunction_or(first_bool:custom_bool_name,second_bool:custom_bool_name):returnfirst_boolorsecond_booldeffunction_xor(first_bool:custom_bool_name,second_bool:custom_bool_name):returnfirst_bool!=second_boolTurn this data:name = Earth
radius = 39000000
terrestrial = True
foo = "ðŸ˜‚"

name = Mars
radius = 12349282382
terrestrial = True
foo = "ðŸ˜‚ðŸ˜‚"

name = Jupiter
radius = 4300012323
terrestrial = False
foo = "ðŸ˜‚ðŸ˜‚ðŸ˜‚"Into this "obfuscated" Python file containing that data:$obfuscatronpython-file.pyencodeoriginal-data.txtobfuscated-python-file.pyResult:_1bdf0020ac0e6cb=intdef_739d460d09a9(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d+_90e68e0bb016ddef_fb4103c9b200(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d-_90e68e0bb016ddef_0ba260174885(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d*_90e68e0bb016ddef_f9d90a0d6672(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d/_90e68e0bb016ddef_a3271bd8e033(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d%_90e68e0bb016ddef_ec4dee8dd39d(_ba3f70e5094d:_1bdf0020ac0e6cb,_90e68e0bb016d:_1bdf0020ac0e6cb):return_ba3f70e5094d**_90e68e0bb016d_47bc061a1719dfeeb=floatdef_ac6c1471eea643(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de+_24220208bfdef_230ee4d679e58a(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de-_24220208bfdef_d4dc6493bf79fe(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de*_24220208bfdef_36599759ee0be1(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de/_24220208bfdef_c098256f8e486f(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de%_24220208bfdef_8edeab92c6b73c(_35f1426de:_47bc061a1719dfeeb,_24220208bf:_47bc061a1719dfeeb):return_35f1426de**_24220208bf_8709a8aa09751c5d=booldef_653c1fd____b(_rp9q563626:_8709a8aa09751c5d,_0eqmvftj17s:_8709a8aa09751c5d):return_rp9q563626and_0eqmvftj17sdef_pceiwy12s6f(_rp9q563626:_8709a8aa09751c5d,_0eqmvftj17s:_8709a8aa09751c5d):return_rp9q563626or_0eqmvftj17sdef_9zleib3qmp0b(_rp9q563626:_8709a8aa09751c5d,_0eqmvftj17s:_8709a8aa09751c5d):return_rp9q563626!=_0eqmvftj17sTo get it back:$obfuscatronobfuscated-python-file.pydecodeget-original-data-back.txtNotesSince Python is a fully dynamic language, any section of code within a Python
script can lookup specific variables, classes, and functions by name. Scripts
using this feature of Python will not work after being obfuscated by Obfuscatron
because Obfuscatron changes the names of all the identifiers in the script. To
properly use Obfuscatron, use an input script that works (to not draw attention
to the variable names storing data), and ensure that no dynamic name
introspection occurs during runtime.