Forum Discussion

venkatareddy's avatar
8 years ago

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
  • 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?
  • "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