encrypting passwords in a python conf file on a windows platform
        Posted  
        
            by Richard
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Richard
        
        
        
        Published on 2010-06-09T12:11:06Z
        Indexed on 
            2010/06/09
            12:22 UTC
        
        
        Read the original article
        Hit count: 219
        
Hello all. I have a script running on a remote machine. db info is stored in a configuration file. I want to be able to encrypt the password in the conf text so that no one can just read the file and gain access to the database. This is my current set up:
My conf file sensitive info is encoded with base64 module. The main script then decodes the info. I have compiled the script using py2exe to make it a bit harder to see the code. My question is:
Is there a better way of doing this? I know that base64 is not a very safe way of encrypting. Is there a way to encode using a key? I also know that py2exe can be reversed engineered very easily and the key could be found. Any other thoughts?
I am also running this script on a windows machine, so any modules that are suggested should be able to run in a windows environment with ease. I know there are several other posts on this topic but I have not found one with a windows solution, or at least one that is will explained.
© Stack Overflow or respective owner