Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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.

0 Kudos