def aes_encrypt(self, message, passphrase): iv = '\x00' * 16 aes = AESModeOfOperationCBC(passphrase, iv=iv) return aes.encrypt(message)
def aes_cbc_encrypt(data, key, enc_iv): cipher = AESModeOfOperationCBC(key, iv=enc_iv) return cipher.encrypt(data)
def aes_cbc_encrypt(data, key, enc_iv): cipher = AESModeOfOperationCBC(key, iv=enc_iv) return b"".join([ cipher.encrypt(data[i:i + AES_BLOCK_SIZE]) for i in range(0, len(data), AES_BLOCK_SIZE) ])
def aes_cbc_encrypt(data, key, enc_iv): cipher = AESModeOfOperationCBC(key, iv=enc_iv) return b"".join([cipher.encrypt(data[i:i + AES_BLOCK_SIZE]) for i in range(0, len(data), AES_BLOCK_SIZE)])