Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
venkatareddy
Level 7

roEVPCipher : Setup working for blowfish, but not for aes

I am trying to use roEVPCipher method to encrypt my data using aes-128-ecb cipher, 
But Its failing in initial setup only, Setup returns error code as -1


Here is my code :

cipher_obj = CreateObject("roEVPCipher")
ret = cipher_obj.Setup(true, "aes-128-ecb", "0123456789abcdef", "", 0)
if ret <> 0
       print "Setup Error" ; ret
end if


Please help me I am struggling from few days
0 Kudos
2 Replies
Highlighted
joetesta
Level 10

Re: roEVPCipher : Setup working for blowfish, but not for aes

Are you using the correct number of characters for the 128 bit key?  According to this stackexchange answer
An AES 128-bit key can be expressed as a hexadecimal string with 32 characters.

But your code has 16, try doubling your key length?
aspiring
0 Kudos
venkatareddy
Level 7

Re: roEVPCipher : Setup working for blowfish, but not for aes

"joetesta" wrote:
Are you using the correct number of characters for the 128 bit key?  According to this stackexchange answer
An AES 128-bit key can be expressed as a hexadecimal string with 32 characters.

But your code has 16, try doubling your key length?

Thanks alot it works for me....Thank you so much
0 Kudos