Hi i have problem with aes-256-cbc encryption. I want encrypt some text in php and after that decrypt it in javascrypt with pidCrypt library.
EDIT: I try to decrypt online here: https://www.pidder.de/pidcrypt/?page=demo_aes-cbc
In console working everything ok (encrypt in php decrypt in pidCrypt) i type this command: (OpenSSL v. 1.0.1i 6 Aug 2014)
echo "some text to en/decrypt"|openssl enc -aes-256-cbc -a
pass: 123456789
I get this:
U2FsdGVkX18c8uPBYdA0af5odtv2WA0Y4a2LhlB3xGUo6pAodMVMAckXr0XcUbJ8
But in php file on server (OpenSSL v. 1.0.1e 11 Feb 2013 OR 0.9.8r 8 Feb 2011 result is the same)
$encrypted = @openssl_encrypt('some text to en/decrypt', 'aes-256-cbc', '123456789');
I get this:
Pqmtan2DSnGKe87JbOmzD5Rz04T3Nwa4K8zqsohPWec=
Outputs are not the same (php file vs console command) and second output can not be decrypted in pidCrypt (but in php file on server yes)
Can anybody help? Why are not result the same? What i must do when i want output as from console?