Skip to main content

Very simple pycrypto AES helper.

Project description

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.

Project details

Release history Release notifications

This version
History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
simple_aes-0.4.7.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None Jul 24, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page