cryptopals (1)

aziz

Cryptopals - set3

Challenge 17 attacking CBC with a padding attack was really interesting, here is my solution from set2 import aes_cbc_decrypt, aes_cbc_encrypt, paddpkcs7, validatepkcs7, split_blocksfrom Crypto import Randomfrom Crypto.Util.strxor import strxordef get_block(text, block, blocksize): return split_blocks(text, blocksize)[block]def produce_ciphertext(plaintext, key): blocksize = len(key) iv = Random.new().read(blocksize) return…

Continue reading...