Skip to content

Instantly share code, notes, and snippets.


tat mush tatmush

View GitHub Profile
ztgrace /
Created Apr 18, 2015
AES ECB chosen plaintext attack example
#!/usr/bin/env python
from Crypto.Cipher import AES
import sys
def split_len(seq, length):
return [seq[i:i+length] for i in range(0, len(seq), length)]
def oracle(chosen):
secret = "foobarbaz1234567890%sSecret42" % chosen # target to decrypt