I am unable to figure out how to use AES 128 encryption. Roku box keeps rebooting in most of the attempts. Otherwise, setup call returns -1. It is working fine if I use "bf” and a 64 bit initialization vector.
Appreciate your help.
Here is my code snippet - wondering if I am doing something wrong
Code: Select all
alg = "aes-128-cbc"
pad = 1
encryptKey = "10a58869d74be5a374cf867cfb473859"
IV = "00000000000000000000000000000000"
plainText = "00000000000000000000000000000000"
encResult = crypto_encrypt(alg, encryptKey, IV, plainText, pad)
Function crypto_encrypt(alg as String, encryptKey As String, IV As String, text As String, pad as Integer) As String
crypto = CreateObject("roEVPCipher")
res = crypto.Setup(true, alg,encryptKey,IV,pad)
ba = CreateObject("roByteArray")
enc = crypto.Process(ba)