AES-CBC encryption with Padding Oracle - CBC-R in 6 lines of code (by me):

ct=bytearray(("\x41" * 16).encode())
while len(pt_padded) >= 16:
pt_N = pt_padded[-16:]
dec = aes_cbc_poa_decrypt_1_block_noIV(ct[0:16])
ct = xor(dec, pt_N) + ct
pt_padded = pt_padded[:-16]

Image: result of encryption and decrypting it again, also with Padding Oracle

#ctf #cybersecurity #cryptography #cbc-r #paddingoracle