I Ilya G. Active Member Licensed User Longtime User Jun 10, 2020 #1 Please help to solve problem with RSA. I'm always get response: Decryption failed PHP: <?php $Private = file_get_contents("PrivateKey.pem"); $messENC = base64_decode($_GET["mess"], true); if (openssl_private_decrypt($messENC, $messDEC, $Private)) { var_dump($messDEC); } else { var_dump("Decryption failed"); } ?> Attachments RSA.zip 11.5 KB · Views: 207 PrivateKey.zip 2.6 KB · Views: 196
Please help to solve problem with RSA. I'm always get response: Decryption failed PHP: <?php $Private = file_get_contents("PrivateKey.pem"); $messENC = base64_decode($_GET["mess"], true); if (openssl_private_decrypt($messENC, $messDEC, $Private)) { var_dump($messDEC); } else { var_dump("Decryption failed"); } ?>
DonManfred Expert Licensed User Longtime User Jun 10, 2020 #2 sure you can use the base64 string to decrypt? Didn´t you need to first uudecode it? Last edited: Jun 10, 2020 Upvote 0
DonManfred Expert Licensed User Longtime User Jun 10, 2020 #4 GanjaKyp said: Sorry, what you mean? Click to expand... sorry, i overlooked the line GanjaKyp said: $messENC = base64_decode($_GET["mess"], true); Click to expand... Upvote 0
GanjaKyp said: Sorry, what you mean? Click to expand... sorry, i overlooked the line GanjaKyp said: $messENC = base64_decode($_GET["mess"], true); Click to expand...