aes-256-cbc decryption fail

i’ve this code in corona:

local openssl = require "plugin.openssl" local cipher = openssl.get\_cipher ( "aes-256-cbc" ) local mime = require ( "mime" ) local login\_check="hello" local encryptedData = mime.b64 ( cipher:encrypt ( login\_check, "test123" ) )

i’m sending the variable “encryptedData” with network.request using GET method

in php side i’ve:

$source = ($\_GET['email']); $pass = 'test123'; $method = 'aes-256-cbc'; $decrypted = openssl\_decrypt ( base64\_decode ( $source ), $method, $pass ); echo ($source ); echo ("\<br\>"); echo (base64\_decode ( $source )); echo ("\<br\>"); echo ($decrypted); echo ("\<br\>");

i’ve got the first echo (source), and second echo (base64 decode) but the decrypted value does not return nothing. it should return “hello” but it doesn’t.

anyone knows what i’m doing wrong? i tried in server encrypt and decrypt and works fine. only if i send from corona encrypted data it will fail.

*edit* sending mime.b64 text and only use base64_decode in php will work fine. the problem is when i add aes-256-cbc encryption

regards,

Carlos.

Guess, no one uses encryption. I gave up on this and used hash SRA-256 instead. I don’t need to decode, just a way to save passwords.

still i think corona encryption library looks buggy, since i could encode and decode easy in server side, and cliente side, only when i try client to server it will not work. it looks like encoding in corona uses different method than server side (using same method on both platforms).

If you can produce a simple demo project that demonstrates it with the relevant PHP script, please feel free to file a bug report. Engineering can’t do much with out it.

Rob

Guess, no one uses encryption. I gave up on this and used hash SRA-256 instead. I don’t need to decode, just a way to save passwords.

still i think corona encryption library looks buggy, since i could encode and decode easy in server side, and cliente side, only when i try client to server it will not work. it looks like encoding in corona uses different method than server side (using same method on both platforms).

If you can produce a simple demo project that demonstrates it with the relevant PHP script, please feel free to file a bug report. Engineering can’t do much with out it.

Rob