Skip to content

Instantly share code, notes, and snippets.

@fletom
Created September 6, 2013 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fletom/6471167 to your computer and use it in GitHub Desktop.
Save fletom/6471167 to your computer and use it in GitHub Desktop.
In [41]: from Crypto.Cipher import AES
In [42]: from Crypto import Random
In [43]:
In [43]: key = b'Sixteen byte key'
In [44]: iv = Random.new().read(AES.block_size)
In [45]: cipher = AES.new(key, AES.MODE_CFB, iv)
In [46]: encrypted = cipher.encrypt(b'Attack at dawn')
In [47]: print cipher.decrypt(encrypted)
{-????n.??u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment