
Send an encrypted file to multiple recipient

Now the file secret.txt will contain the actual text written. Since decrypt operation will be performed by using your friend’s private key, it will ask for the passphrase provided by your friend while creating keys. In order to view the content of the file, he need to decrypt the file. Now your friend would have received your encrypted file. $ gpg -encrypt -armor -recipient raman a.txt Decrypt a file If you don’t want to send a binary content, or there are issues in sending binary, you can use the –armor option which creates an ASCII file as shown below. Send this file to your friend by any means. It will create a file named “a.txt.pgp”, when opened using editor, it will have some binary data. As of now, since I trust my fried, I’ve given “Yes” to use the key. We will look back at this when time permits. Note that there is a warning, which says, there is no guarantee that the “Public Key” belongs to your friend. You may answer the next question with yes. It is NOT certain that the key belongs to the person named Primary key fingerprint: FF32 7764 A0AE 1E85 AC4B CF17 8AED B292 FB27 44A8 Gpg: 88EF55EE: There is no assurance this key belongs to the named user Now that you have the public key of your friend, you can send him a file, which is encrypted using “Your Friend’s Public Key”, so only your friend ( Who is having the private key ), can decrypt it. Encryp a secret file using your friend’s public key Now I’ve my friend Raman’s public key imported.ģ. You can verify whether you have successfully imported your friend’s public key using –list-keys option $ gpg -list-keys If your friend has E-Mailed you his/her public key, then you can import those keys by using the following command $ gpg -import myfriends_pub_key.gpg 2. To import public key from a file, do the following.

$ gpg -search-keys -keyserver 'Real Name' $ gpg -search-keys -keyserver 'E-Mail ID' Provide your friend’s Key-ID or E-Mail ID or Real Name to import the keys correctly. You can import by using any one of the above methods. To import public key from a key server, do the following.
#Gnupg mac encrypt text how to#
Refer to the “Export Your Public Keys” section in our GnuPG Basics article to understand how to export your public key to a key server. You can import your friends public key from a “Key server” if he/she has exported their public key to a key server. When you want to send a secret file to your friend, the first thing to do is to import your friend’s public key. In this tutorial, we will use the keys generated by gpg command to send and receive encrypted files, and digitally sign a file.Įncrypt a file and send it to your Friend 1. Using GnuPG gpg command you can generate public and private keys.
