This tool automates and facilitates a padding attack on AES with ECB mode
ecb = Padding_Attack(
cipher = cipher,
know = b"ThIs",
left_pad = True,
charset = "abcdefghijklmnopqrstuvwxyz"+\
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +\
"0123456789" +\
"!*-/+_"
)
for flag in ecb.attack():
print(flag)
plaintext
: random_padding[1-16] + input + flagplaintext
: input + flag
cipher is a function that takes bytes as input and returns the encrypted bytes