cse_7.py 268 B

12345
  1. def decrypt_cbc(content, aes_key, iv):
  2. aescbc = Cipher(AES(aes_key), CBC(iv)).decryptor()
  3. padded_result = aescbc.update(content) + aescbc.finalize()
  4. unpadder = PKCS7(AES.block_size).unpadder()
  5. return unpadder.update(padded_result) + unpadder.finalize()