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

I want to clarify the question: these scripts do not output anything to the terminal session.

You simply run the script for execution and if there are no errors in the code, then it is executed. The first script creates an encrypted file "puzzle.encrypt" and the second script creates a decrypted file "puzzle.encrypt.decrypt" from a file "puzzle.encrypt".

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

Replies are listed 'Best First'.
Re^3: RSA encrypt but no decrypt. What is the problem?
by Anonymous Monk on May 07, 2021 at 01:43 UTC
    Forb, "you tell us that there is a problem." Now show us – "what, exactly, 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?

        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.