Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Binge Watcher

AES-256-CBC cipher Set Up failes

plaintext ="Hello World"
cipher= "aes-256-cbc"
encryptKey = "7786b7cde4d77e8cbb585e9535f3aa7b"
IV =""
pad = 1

encResult = crypto_encrypt(cipher, encryptKey, IV, plaintext, pad)

function crypto_encrypt(alg, encryptKey, IV , plaintext , pad )
crypto = CreateObject("roEVPCipher")
res = crypto.Setup(true, cipher,encryptKey,IV,pad)
print res
ba = CreateObject("roByteArray")
enc =crypto.Process(ba)
return enc.ToBase64String()
end function


i'm trying to use EVPCipher method to encrypt my data using Aes-256-cbc cipher,but i'm not able setup cipher.its always return -1. Please suggest me, how to use aes-256-cbc cipher encryption.