Skip to content

Instantly share code, notes, and snippets.

Avatar

tat mush tatmush

View GitHub Profile
@ztgrace
ztgrace / ecb_oracle.py
Created Apr 18, 2015
AES ECB chosen plaintext attack example
View ecb_oracle.py
#!/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