pip install -e git+https://github.com/ostinelli/PyAES256#egg=pyaes
How to use
import aes256
key = "aserghjerg4w5ygb8JHBr8ySuhrergiE"
encrypted = aes256.encrypt("My testing clear text", key)
decrypted = aes256.decrypt(encrypted, key)
print decrypted
# Out: My testing clear text
so
When you want to treat it as a character string
import base64
encrypted_str = base64.b64encode(encrypted)
# Out: d/YSHFGxeeJhNdMeU0ukrKAP90bC0S+UpEWz1V/xOk4=
decrypted = aes256.decrypt(base64.b64decode(encrypted_str), key)
# Out: My testing clear text
iv (initial vector) probably uses the same value all the time
Recommended Posts