skip to navigation
skip to content

simple_aes 0.4.7

Very simple pycrypto AES helper.

Very simple encryption helper for pycripto


pip install simple-aes


>>> from simple_aes import SimpleAES
>>> enc = SimpleAES('test', use_salt=True)
>>> encrypted = enc.encrypt('test')
>>> enc.decrypt(encrypted)

Parameter “use salt” use salted algorithm. You get different encrypted values each times. But you must be careful. Sometimes this may make encryption of weaker. I will try to explain it. If you try to encrypt identical phrase more times with salt in theory your encryption key may be opened via differential analysis. But when you sure what you not doing it, it’s makes encryption stronger.

Encrypting big files

For encrypting big files you may using EncryptIO like this:

>>> print "Encrypting..."
>>> f = EncryptIO('secret', open('test', 'wb+'))
>>> f.write('Hello world 1024 times. ' * 1024)
>>> f.close()
>>> d = EncryptIO('secret', open('test', 'rb'))
>>> print "Decrypting..."
>>> data = ''
>>> for i in d.decrypt():
...     data += i
>>> print data

This write data to file with encrypting and ZLIB compression. You may change compressor via changing class-property COMPRESSOR.

File Type Py Version Uploaded on Size
simple_aes-0.4.7.tar.gz (md5) Source 2014-07-24 3KB