Skip to main content

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.

Metadata

Release files for simple_aes 0.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple_aes 0.4.7
File Size Uploaded
simple_aes-0.4.7.tar.gz 3.4 kB Details

Release files / simple_aes-0.4.7.tar.gz

Download URL simple_aes-0.4.7.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4198523f3f41aa2ecd7552be641a0eecac2a1654ff6c4b41f42859b0c67bd9f8
BLAKE2b-256 checksum
How to use checksums
dc655526c08b69dc561383a509cd3d2e2f040486dfca0049e7d9ec4932c8ff50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4.7 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page