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.