encrypted files

Anyone have some ideas on how to encrypt files. I need to
1. Encrypt .py files so they can be python version independent
2. hide the encrypthion algorithm.

I can do this now, but I need to know if there is a better way than creating a .pyc file out of the encrypthion algorithim which is in the function that the import manager uses when it encounters a .pye file (encrypted python file) The .pyc file has to be created for every version of python.

Thanks

Comments

  • : Anyone have some ideas on how to encrypt files. I need to
    : 1. Encrypt .py files so they can be python version independent
    : 2. hide the encrypthion algorithm.
    :
    : I can do this now, but I need to know if there is a better way than creating a .pyc file out of the encrypthion algorithim which is in the function that the import manager uses when it encounters a .pye file (encrypted python file) The .pyc file has to be created for every version of python.
    :
    : Thanks
    :

    I assume that your main attention is to hide your original code so that your code is your code and no one else can steal it.

    There are a lots of ways to try to implement such a thing and here's my idea:

    1. Invent a strong encryption/decryption algorithms that you think no one will think of.

    2. Implement the decryption process into a Python Extension Module with pyrex (http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/)

    3. Pickle your original code and encrypt it as hard as you can

    4. Never write the unpickled (and decrypted) code in the disk.

    5. If you don't need to hide all the code, preferably encrypt only the sensitive parts as pickles, use many pickles and remove them from memory as soon as possible.

    6. Camouflage your decryptor someway, give a picture that there's nothing to hide ;)

    That's the way I'd do the code hiding.. Of course, there are always people who can reveal the code but fortunately they don't come as so many and propably won't hit to your program. (or let's just wish so) :)


  • Maybe you know what command I have to type to compile my test.py file? Please help...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories