Python

Moderators: None (Apply to moderate this forum)
Number of threads: 473
Number of posts: 1165

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
encrypted files Posted by Blue_screen on 2 Oct 2003 at 5:33 AM
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
Report
Re: encrypted files Posted by CSXM on 6 Oct 2003 at 2:11 AM
: 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) :)


Report
Re: encrypted files Posted by Lobomoon on 2 Feb 2004 at 4:29 PM
Maybe you know what command I have to type to compile my test.py file? Please help...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.