def decrypt_aes(key, iv, data): mode = AES.MODE_CBC cipher = AES.new(key, mode, IV=iv) return cipher.decrypt(data)