rsapublic-key-encryptionopenpgp

How can encrypt\encode (Base64) for a generated key including message with 2nd public data key in OpenPGP medium?


I'm using Kleopatra after installed Gpg4win. I have generated an RSA key pair with a 1024-bit key size, using my name as the username using Windows Command Prompt. I was suppose to genearte and sign the message without encrypting it as below:

Message to sign: I am a learner....

Now I can access the all Certificates in Certificate window uisng GUI. The top one is public key of my friend and below one is the one I just generated. img

Now, I want to encrypt the new generated key using another public key belongs to my friend, then encode the final output in Base64. How can I do it via GUI or in Windows Command Prompt?

I want to read content of the final_msg_base64.txt.gpg


Solution

  • I am assuming that you know what you are doing, when you share your private key. I wouldn't recommend doing that if it's not strictly necessary.

    You need to export your private key, save it, open the file explorer, and right click the key file to open the context menu. In the context menu you should see an entry "sign and encrypt", select that and follow the steps.

    Here you can find a step-by-step description.

    Once you have an encrypted file, you can go ahead and encode it base64.

    After that you'd have a file "final_msg.txt.gpg.base64"