You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decryption using PHP Openssl 1.1.1w fails for a Cipher encrypted using hybrid-crypto-js v4.2.0.
I have verified that the key pair matches.
Is there anything else I am missing here? Kindly help.
JavaScript:
const publicKey = "returned from php reading public_key.pem";
const plainText = "plain text here";
var crypt = new Crypt();
var encryptedText = crypt.encrypt(publicKey, plainText);
// send JSON.parse(encryptedText).cipher to php
Decryption using PHP Openssl 1.1.1w fails for a Cipher encrypted using hybrid-crypto-js v4.2.0.
I have verified that the key pair matches.
Is there anything else I am missing here? Kindly help.
JavaScript:
const publicKey = "returned from php reading public_key.pem";
const plainText = "plain text here";
var crypt = new Crypt();
var encryptedText = crypt.encrypt(publicKey, plainText);
// send JSON.parse(encryptedText).cipher to php
PHP:
$privateKey = file_get_contents("./private_key.pem");
$ret = openssl_private_decrypt(base64_decode($_GET['encrypted_text']), $decryptedText, $privateKey);
if (!$ret) echo "decryption failed";
else echo "Decrypted Text: " . ($decryptedText);
The text was updated successfully, but these errors were encountered: