Created
September 6, 2013 23:03
-
-
Save fletom/6471167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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