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: 
venkatareddy
Visitor

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 2
joetesta
Roku Guru

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
Visitor

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.