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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vinodmangalath
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")
ba.FromAsciiString(plaintext)
enc =crypto.Process(ba)
return enc.ToBase64String()
end function

Hai 

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.