in reply to Re^3: RSA encrypt but no decrypt. What is the problem?
in thread RSA encrypt but no decrypt. What is the problem?

In addition to the code, I can provide the contents of three files that the scripts work with.

The source file "puzzle" to be read by the script "RSA_encrypt_test.pl":

Hello!!!

The "puzzle.encrypt" file that is generated by the "RSA_encrypt_test.pl" script:

pG+┼V▄læ║┌▄28≈é)E@▀1u┐[/ⁿ▄n,╘k╗µç7╚╝└m«wI╠╬Ñ«▌C,▄ I

The "puzzle.decrypt" file that is generated by the "RSA_decrypt_test.pl" script:

3┴Γ`Æ$├Ç⌐»óñ¼\4kôT¢H"¿▀┐±ë┘═I<Θ è▐ì▄SlpçÆΘYÖHA╬{≥─╧⌠FvO%}╓<

Thus, you can see that the decryption script is not working. Since it does not decrypt the ciphertext "Hello!!!" correctly

What information may not yet be understood?

  • Comment on Re^4: RSA encrypt but no decrypt. What is the problem?

Replies are listed 'Best First'.
Re^5: RSA encrypt but no decrypt. What is the problem?
by bliako (Abbot) on May 07, 2021 at 07:58 UTC

    I have managed to run your scripts and saw the problem. I have no idea what is the correct way to do this with this specific module. But when I tried changing the padding method it kept complaining.