Created
December 22, 2014 07:40
-
-
Save AntonKueltz/07a2098aff79880fe3ac 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
from Crypto.Cipher import AES | |
def AES_ECB_decrypt(ctxt, key): | |
ptxt = '' | |
cipher = AES.new(key, AES.MODE_ECB) | |
for block in range(len(ctxt) / AES.block_size): | |
start, end = block * AES.block_size, (block+1) * AES.block_size | |
ptxt += cipher.decrypt(ctxt[start:end]) | |
return ptxt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment