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

Forb, "you tell us that there is a problem." Now show us – "what, exactly, is the problem?"
  • Comment on Re^3: RSA encrypt but no decrypt. What is the problem?

Replies are listed 'Best First'.
Re^4: RSA encrypt but no decrypt. What is the problem?
by Forb (Novice) on May 07, 2021 at 06:23 UTC

    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?

      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.