Edited at

pythonでAES256

More than 5 years have passed since last update.

pip install -e git+https://github.com/ostinelli/PyAES256#egg=pyaes

使い方

import aes256

key = "aserghjerg4w5ygb8JHBr8ySuhrergiE"
encrypted = aes256.encrypt("My testing clear text", key)
decrypted = aes256.decrypt(encrypted, key)
print decrypted
# Out: My testing clear text

文字列的に扱いたいときは

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)はたぶん同じ値をずっと使ってる