LoginSignup
1
2

More than 5 years have passed since last update.

pythonでAES256

Last updated at Posted at 2014-01-09
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)はたぶん同じ値をずっと使ってる

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2