0

I wanted to know how it would be possible to run an ML model in an offline setting securely? What I mean is, if the Python files and libraries are bundled as an .exe file (using libraries like py2exe or PyInstaller) for distribtion, is it possible to decompile the executable and obtain the source code if reverse engineered properly?

From the research I've done, I've seen packages like uncompyle6 get a lot of praise for being able to decompile executables properly. However, I have observed lesser decomplilation facilities for newer versions of Python, (specifically 3.8 and above). I tried to decompile the .pyc files which are just bytecode and they were decompiled pretty easily. However, I'm facing a harder time decompiling .pyd files.

What practices does the industry follow for this, to make reverse engineering really hard? Realistically, what measures can I take to make sure that the code does not get leaked/stolen? Thank you!

1 Answer 1

1

If I understand your requirements correctly what you need is pyarmor or something similar such as oxyry or pyobfuscate. These packages are able to obfuscate the code, which makes reversing harder. Pyarmor is also able to "pack" the obfuscated code with PyInstaller. This means that after decompiling resulting executable the reverser will get obfuscated scripts, which are harder to comprehend. Please note that pyarmor is licensed, and costs in a range of approximately $[50:160], depending on features you need.

It should be noticed, that if the computer is able to execute some sequence of instructions, then this sequence is readable, so the only thing the obfuscation provides you is a time until your script is reversed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.