Closed emitof9999 closed 4 years ago
Finally i found solution from others forum to resolved my problem
Dart:
var aesEncrypter = AesCrypt('my 32 length key................', 'cbc', 'pkcs7'); //generate AES CBC block encrypter with key and PKCS7 padding
var iv = 'my 32 length key';
String encrypted = aesEncrypter.encrypt('somedatahere', iv); //encrypt
String decrypted = aesEncrypter.decrypt(encrypted, iv); //decrypt
print(encrypted);
print(decrypted);
PHP:
var_dump(openssl_decrypt(base64_decode($ENCRYPTED_FROM_DART), "AES-256-CBC", "my 32 length key................", OPENSSL_RAW_DATA, "my 32 length key"));
Glad to hear it worked out! Thanks for your efforts, and happy coding!
Hi,
I totally no idea how to decrypt it in PHP and shell based OpenSSL.
Attempted to decrypt, but nothing to be print out.. Means maybe mode, IV or key is different....
Meanwhile, how to encrypt it with AES-256? It looks like not support aes-256-cbc
This is my PHP code :
Thank you.
Regards,
Gordon