Python code obfuscator
Do you need to make your python code smaller? If you’re using the BitBoost ‘bobs’ Python obfuscator, you just need to pick the right options.
Tell the obfuscator to rename your variables, functions, classes, etc. in a space-saving way.
This will shrink practically any release format you might use: source code, byte-compiled code, executables, etc.
In the default renaming scheme, each replacement name consists of a ‘stem’ string + a numeric index. So…
Go from verbose names…
import dance_club class Discotheque(dance_club.DanceClub): def __init__(self, epilepsy_risks, deafness_risks): self.epilepsy_risks = epilepsy_risks self.deafness_risks = deafness_risks self.start_mirror_ball_rotation() # ...
…to short names.
import qy9 class qq45(qy9.qx20): def __init__(qy3e, qz3f, qq46): qy3e.qz3f = qz3f qy3e.qq46 = qq46 qy3e.qa50() # ...
These steps are taken every time you obfuscate. Depending on your coding style and release format, these automatic reductions may make your released code significantly smaller.
The obfuscator lets you mark sections of your source code to redact from your obfuscated release.
Because you can define additional code redaction directives in your obfuscation project files, you can enable different redaction directives when building different obfuscated releases.
Applications include:
if 'PREMIUM_LICENSE_RELEASE': # Define board designer that provides premium license level functionality. class BoardDesigner_Premium(BoardDesigner): def __init__(self, strategy_chooser=None): self.strategy_chooser = strategy_chooser # ... # ... if 'UNIX_RELEASE': # If 'UNIX_RELEASE' is included in the project's redact_directives_added, # this gets redacted during obfuscation unix_stuff_part_1() more_unix_stuff() another_unix_thing() i_sure_like_unix = True # ... if 'WINDOWS_RELEASE': do_windows_stuff() # ...
See the “Reducing Code Size” use case and the redact_directives_added project file setting in the obfuscator manual.
© Copyright 2018 by BitBoost
BitBoost, BitBoost Systems, and 'bobs' are trademarks and/or service marks of BitBoost