Simple encryption and decryption for Python 3
Project description
What Does Simple Crypt Do?
Simple Crypt encrypts and decrypts data. It has two functions, encrypt and decrypt:
from simplecrypt import encrypt, decrypt encrypted = encrypt('password', plaintext) plaintext = decrypt('password', encrypted)
That’s it. You can see the implementation on github.
Why Should You Use Simple Crypt?
It uses standard, well-known algorithms, closely following the recommendations here.
It uses routines from the established pycrypto library (the cipher used is AES256).
It includes a check (an HMAC with SHA256) to warn when encrypted data are modified.
It tries to make things as secure as possible when poor quality passwords are used (PKBDF2 with SHA256, a 128 bit salt, and 10,000 rounds). But that doesn’t mean you should use a poor password!
Using a library, rather than writing your own code, means that we have less solutions to the same problem. That means more chance of finding bugs, which means more reliable, more secure code.
What Else Should I Know?
You must also install pycrypto.
The outputs from encrypt and decrypt are bytes. If you started with string input then you can convert the output from decrypt using .decode('utf8').
mystring = decrypt('password', encrypted).decode('utf8')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file simple-crypt-0.1.6.tar.gz
.
File metadata
- Download URL: simple-crypt-0.1.6.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533ec83cc97c4e4195b2b8948d87e4a7bc8777b22baf1ced83ecb749e73d9836 |
|
MD5 | 11411713008c783731b20aae356f6d54 |
|
BLAKE2b-256 | c89df8c5428fd91046494d4725e534cfa3fc15248c7316f688f16351e1495219 |