lightweight encryption of text file

Paul Rubin no.email at nospam.invalid
Sat Jan 9 15:03:16 EST 2010


Daniel Fetchinson <fetchinson at googlemail.com> writes:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. 

For encrypting strings, use this module:

   http://nightsong.com/phr/crypto/p3.py

Obviously this is limited to strings that fit in memory, which
might be a problem with large files.   Some day I might get
around to adding a streaming interface to it.

The "file" command will not recognize the ciphertext as encrypted
data.  It will just say "data".  

If you want to be more serious, use pgp or gpg with the -c option
(password-based encryption).  I think "file" does recognize the pgp
file format as encrypted data (RFC 2440).



More information about the Python-list mailing list