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 details)

Uploaded Source

File details

Details for the file simple_aes-0.4.7.tar.gz.

File metadata

  • Download URL: simple_aes-0.4.7.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simple_aes-0.4.7.tar.gz
Algorithm Hash digest
SHA256 4198523f3f41aa2ecd7552be641a0eecac2a1654ff6c4b41f42859b0c67bd9f8
MD5 b7d71d5ee148a16051ff0bf9850cc4db
BLAKE2b-256 dc655526c08b69dc561383a509cd3d2e2f040486dfca0049e7d9ec4932c8ff50

See more details on using hashes here.

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