Skip to main content

Very simple pycrypto AES helper.

Project description

Very simple encryption helper for pycripto

Installation

pip install simple-aes

Using

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

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


Download files

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

Source Distribution

simple_aes-0.4.7.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page