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