Web Hosting Talk







View Full Version : how do you protect python/ruby source code?


jt2377
12-29-2006, 02:49 AM
is there any encoder for python or ruby? how do you protect your source code written in python or ruby? is there any opensource or commerical solution?

ylsy
12-29-2006, 11:34 PM
is there any encoder for python or ruby? how do you protect your source code written in python or ruby? is there any opensource or commerical solution?

On windows or on linux?

With Python you can just distribute the compiled byte-code so you don't need to distribute the source code, i.e. the .pyc or .pyo files. You can also use something like py2exe to bundle up the compiled byte-code into an .exe file. Or you can write your own __import__ handler with your own encoding/decoding routine (with encryption for example).

It's trivial to reverse engineer the compiled bytecode however...

jt2377
12-30-2006, 01:27 AM
On windows or on linux?

With Python you can just distribute the compiled byte-code so you don't need to distribute the source code, i.e. the .pyc or .pyo files. You can also use something like py2exe to bundle up the compiled byte-code into an .exe file. Or you can write your own __import__ handler with your own encoding/decoding routine (with encryption for example).

It's trivial to reverse engineer the compiled bytecode however...

nevermind.

Elliot A
12-30-2006, 05:49 AM
Python 2.4 does not have any available decompilers for the time being. There are ones out there for 2.3 but not 2.4.

Ruby doesn't have a byte code compiler or encryption mechanism that im aware of either.