https://github.com/boppreh/aes

About

A pure Python implementation of AES, with optional CBC, PCBC, CFB, OFB and CTR cipher modes.

  1. import aes, os
  2. key = os.urandom(16)
  3. iv = os.urandom(16)
  4. encrypted = aes.AES(key).encrypt_ctr(b'Attack at dawn', iv)
  5. print(aes.AES(key).decrypt_ctr(encrypted, iv))
  6. # b'Attack at dawn'