Hi BitcoinTalk!
I have re-posted
mdayonliner [Eng: Tutorial] PGP Signature - Encrypt/Decrypt message - Fingerprint because the images of main thread was broken and the author is not active anymore. As
Husna QA suggested, I decided to write a tutorial for Linux users.
Image source: encriptados.io
➥ More PGP Tutorials:
➥ Install Gnupg and gpa:Let's get started!
Open your terminal and paste this command line
sudo apt-get install gnupg2 gpa
If you have given the root privilege already, it won't ask for the password. If you haven't, please write your system password, and it should install gnupg2 and gpa. Look at the screenshot below;
➥ Generate Key:Paste this command line in your terminal
, and it will ask what kind of key you want to generate. RSA and RSA are the default, and I will generate the RSA and RSA one. To generate RSA and RSA keys, type 1 and enter.
RSA keys can be from 1024 bits to 4096 bits long. 3072 is the default one, but I am creating 4096 here. So write 4096 and hit enter. See the image below;
Now, you can set the expiration date of your keys. 0 defines the key won't expire. I am going with 0. Write 0 and hit enter. Write Y and hit enter again.
It should ask for your real name (You don't have to write your real name, of course), email, and comment. I am writing mine. Then, write O and hit enter again. It will ask for your passphrase, write your passphrase, and it should generate your keys. See the image below;
Now paste this command line
If you do not get any errors, please skip the next part.
If you get the error
failed to load module canberra-gtk-module
it could be a reason for being unable to create your keys even though it shows the keys were generated. If you are on an Ubuntu or Debian system, first apply this
and then install Libcanberra
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module -y
After that, again try
, and it should open the GUI of GNU Privacy Assistant, and you can create your keys from here. I believe you already know how to do that.
Ok. I have generated my keys already, and you can see them below;
➥ Export Public Key: To export your public key, right-click on your key and select Export keys...
Select your destination and write a name with .txt extension. In my case, I wrote publickey.txt
To see your public keys, open the file. In my case, this is my public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGVGVnoBEACsg6GWMYbztqxe0bKbiCZ12/ngcPaw6IKPd/g8RfIIuqISEgGU
hfvj0ulted8RKm0kL/kEG782EpbAVHEIIbnU0tluhLG6z9EieLfXWkmT9JEZViKR
JylFDDsxYJ5cWlccTNddfIAxZ5PWS445TVUDTnApaw68gciXoq5K3v70nZZUD/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FAmVGVnoCGwwACgkQ4nlRUSlhlqMSHg/9E9i+8JPR5HgkwYwjcd+A
HBlNaRdU6Tz71tQHhITV23u6I8wfZ4yplXnbHBx65g+uPyzMA5sHRyGagviNg4fj
8JTBkl7u/kW+tWK7zbFoRuoWkucW6T4veDgPveeMaSK9eskNw1tY86NktmKA1mSn
G3gQi9Cbs0bOGwJd1scaDf1p8ChRYXlmUNZt7OiWyctlK/qk7WsXi7UNOW/LeepB
MnnBFnul/IRKDDJoEOPa719S6yWDr6I0jcXZ2NwKfdDaNyp+JIvH4Rb9K2db91Na
BAvcjGZevDRfVwcoK5rbjfX6FL0yfi9jYfXerfHof3x73NSrKKc7obwqHfCE2YvY
gxeRheCkDtHqSV1gowNP5vzKPc+MqNaPgujo8FujJr3g5tOvfzU5nXjRgPk60KyF
kObYv83PW3ukrIihUoJZb8tolci2XycU5Yp8cMrus8FpKi/dDi5CAN/8gS7QyF9B
YXAwgZnDP41c8rbp1eJuh1bEFO77o8pHUG5xZN2fSRg3SgW3qcssJqo/BBrYEqkg
g2mxbTonfkw5i4zpS9UqJ8Iy1m+gX/P9I7JyzL+VpqFydpf5IMAVwhb0XSxI5VwX
N/5nH3IgEDUBSt5bEfAmiaSxsth3SakSeRYG5ICkTr4RSOqHVBdAEODWBGMIqCdd
gFy/cFXnbPeYtqGrdUCuKq8=
=t6jo
-----END PGP PUBLIC KEY BLOCK-----
➥ Export Secret Key: To export your Secret key, right-click on your key, select Backup, and save the file. It will ask for your passphrase.
➥ Send Encrypted Message: Now, I am going to send an Encrypted message to BitcoinGirl.Club using his Public Key:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZMghNBYJKwYBBAHaRw8BAQdA+IDRMqmKdzj0eiBee8MjUJ71Sl11HJDEKwuv
eONy9We0ImJpdGNvaW5naXJsIGNsdWIgPGJnY0Bub2VtYWlsLmNvbT6IkwQTFgoA
OwIbAwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBFDZejW2cobfuR3fPWOx
Ut7+xyg9BQJkyCG+AAoJEGOxUt7+xyg9E5MA+wS51d5leJ0noKkZlEfAjEqBt/ca
li0mfmKfw9U5LXLrAQC3ncYEyJHrzlNXAav1myyvKZEXQ1WAGafIHeRdcleJALg4
BGTIITQSCisGAQQBl1UBBQEBB0ChNUGhTHWOLKkMNBXFG6/Rl/wWrZ4ad3ppaKtA
Cs3BLwMBCAeIeAQYFgoAIAIbDBYhBFDZejW2cobfuR3fPWOxUt7+xyg9BQJkyCHK
AAoJEGOxUt7+xyg9l9YA/RKyt4OQVeDb1coppNdMVsptCnfB+66fShrn1ij7n9XA
AP4ntoJBo0w4PDIbuCEtOPRjUAk+pC3iaaC2Dq1hU4b+Bw==
=wFDZ
-----END PGP PUBLIC KEY BLOCK-----
I have saved his Public key block in a .txt file and imported it. See the image below;
Now click on the Windows tab and click on Clipboard.
Write your message, click on the file, and choose encrypt (See the image below):
Now click on Bitcoingirl's public key and click on the sign, too. It will ask for your passphrase; enter your passphrase and boom! Your encrypted message will appear in your Clipboard.
-----BEGIN PGP MESSAGE-----
hF4DHD+iqLgO/5wSAQdAYQqzh5+Bj9mNagMn0ZXEzOG6wNFCBiXxpMnSMPDCr00w
rvpcDpcGPifQOTSeW++yX+gEAUwh3Nuz2chHSe2m5mRIthHNbXZXVLqnqDGAp5G3
0ukBFTQutKV3HrFTnSBc9IauNim5EdqywFRRigNsxG5z6VWCR7ecQtqYmEnvHNFv
orgPj2KC90VJ0eA1IZ/OzNyW7VqXrcDaH+0iUAFrlkEN9jf+d+OzpBvVLf8H8WZc
lSi2zP+GdSgA0ITIM6gWhirA/wkeOBXPE9H4eiq+da36JYmUSRxGHR7AZlmt/v+W
OD8REjHxSISWvMbuN703QKV6KVZ0K4JOEQaIdeRu6zYDueMV+YNGMC8eH8doMFlT
yPpJbi8MM+qFTuno+iDCR/2HzdAUVGrExzIr4ZZoIkCaOlmL8ZIJBcnMVnjySVFJ
t+Wb3fspFERX8jnw8pyt4l2EUbpY1F+OQ4YOGhvkZd3rbPkt9qRE+JUvPUx+Carz
RX08qe5qHVvjajfppewoypDkXto5wfDILIVEyIuhqo1/aIFyEhXdRO6sWqt2EeGA
+XQpgfd6xWhEESk3lq+bTDHseqzI1Hs4Dng4Yjdx0L2Y91Ag9tj/cyyKyHi0nMam
/t1SBpMSotfV3CnCUdMh9gHdok43e9b5hObXVpd7jjU2PH443xvfrZtiKlvvGUdd
fUZuMFilx7Clfm4YukrzM6ntg2U+uINRKDLWaf1JA2zd4DET41gNdgkTNQxnT/It
02hrqyI+TfjzhdP6Kls4O2e4hhusIXqtKwut0W2zjfc7YqhA3SBHOJJjd2d4xoky
Kn7AK8xh+RcLWhDAVMV+/NJkJKjveLpgbrtw/0QU/WM1V8e5RGedtlJUHjwS6s34
QnHrgOFDmnSsachXKxv53kzwGNkmtzdoLFedQTLXWu16rlSlO7bbPTTP8YiXDxOJ
WkC7xNbERFdTC51pd2moWJfot4mp8kpKN22ItZZvRIYIkDX2a01xOP1aflDCszuB
+YRdjN991l81KiY=
=WwRm
-----END PGP MESSAGE-----
There we go. We are done already. Let me know if I made any mistake here because I have been using Linux for a month only.
If you face any problem, post here, and I will try to help fix it. Even If I couldn't do it, there are a lot of community members who can step up.