PGP Cryptography Guide - Using Government Grade Encryption in Personal Correspondance
02-03-2016, 10:06 PM
Greetings. As we are nearing the international meetup day, it has occurred to me that many of us wish to communicate privately, without fear that their details would get exposed but don't necessarily have the means or know-how to do so. Forums can be hacked, deleted PM's can be rolled back from database backups and hosting companies can be subpoenaed by governmental entities in order to gain access to aforementioned confidential information. Coupled with the fact that there's nothing that a drooling SJW with no respect to privacy wouldn't do to bring public attention to people exercising their right to free speech on the internet for their mental masturbation and sometimes 5 minutes of fame, it is pretty clear that we should use all tools at our disposal to ensure that our private communications are not monitored.
In this guide I'll tell you about PGP. PGP stands for Pretty Good Privacy and it's pretty good. It is a software program created in 1991 to encrypt and decrypt e-mail messages, but it has come a long way since then. Today it's almost an industry standard in this field with multiple open source implementations based on the same principles. If you send and receive emails containing sensitive and confidential information, update the software on your iPhone or buy drugs with bitcoins on the Deep Web, this is what keeps your data safe. It primarily uses the RSA algorithm, which is based on the principle of Asymmetric Cryptography.
What is asymmetric cryptography?
Simply put; if you have a safe and a key to lock and unlock it, you use the one key to both lock and unlock the safe and this is called symmetric cryptography. However, if you have a safe, a key that can only lock it, and another key that can only unlock it, this is asymmetric cryptography. You unlock the safe, make duplicates of the locking key and hand it out to other people. They lock it with the lock key and ship the safe back to you. You then unlock it and read the contents with the unlock key that you share with no one.
In RSA the lock key is called a Public Key and the unlock key is called a Private Key -- or sometimes a secret key. You give your public key to anyone that wishes to contact you privately. Under no circumstances should you ever give out the private key to anyone.
If you own the private key you can generate the public key from it. If you only have the public key, you can not use it to generate the private key. Technically you can, but you, everyone else in the universe and the universe itself will die before you can crack it with 21st century computing power.
This is all the theory you need to know. I'll give a quick tutorial on how you put this all into practice. I'll explain it for Windows and Mac OS X operating systems. If you use Linux you're probably tech savvy enough to figure this out yourself so I won't go into that.
So I'm the Thing. I want to communicate with another person privately. I use a Mac, so I go to https://gpgtools.org and download GPG Tools. Download and install it. Right after the installation it'll ask you to create a public/private key pair. Put in your name and create one. If you miss it, you can create one after you launch the newly installed key manager GPG Keychain afterwards by going to the menu option File > New Key. It'll look something like this:
![[Image: newkey.jpg]](http://s7.postimg.org/rds3sk73r/newkey.jpg)
You only need to fill in your name. If you wish to give this key out publicly and stay anonymous, don't give your real e-mail address, or better yet, don't give any email address at all, since your public key will include your email address. You can set a passphrase to lock the private key even further but if you forget the passphrase you lose the private key and by extension, the public key associated with it.
You created your key pair? Good. Right click on it and go to Details, it'll look something like this:
![[Image: Screen_Shot_2016_02_04_at_1_04_59_AM.jpg]](http://s7.postimg.org/av4czqjnb/Screen_Shot_2016_02_04_at_1_04_59_AM.jpg)
You can see that it's an RSA key, I have both the public and private keys for this pair and it's a 4,096 bit key. More bits mean more security, every single bit doubles the difficulty of cracking it by brute force. Now I should give the public key out to people. Right click on Export to save it anywhere you want. If you email the key you can leave it as is, but I'll copy and paste it to places so I append .txt to the file name in order to make it open in a text editor when I double click the file.
![[Image: Screen_Shot_2016_02_04_at_1_17_36_AM.jpg]](http://s7.postimg.org/65efb4smv/Screen_Shot_2016_02_04_at_1_17_36_AM.jpg)
![[Image: Screen_Shot_2016_02_04_at_1_18_14_AM.jpg]](http://s7.postimg.org/ec6f2pipj/Screen_Shot_2016_02_04_at_1_18_14_AM.jpg)
![[Image: Screen_Shot_2016_02_04_at_1_18_29_AM.jpg]](http://s7.postimg.org/bjd7ioid3/Screen_Shot_2016_02_04_at_1_18_29_AM.jpg)
Double click the file to open it in a text editor. It's a bunch of characters representing my public key:
![[Image: Screen_Shot_2016_02_04_at_1_18_42_AM.jpg]](http://s7.postimg.org/6ojikek1j/Screen_Shot_2016_02_04_at_1_18_42_AM.jpg)
I'll PM this key to a guy who wishes to engage in a secure PM conversation with me. He uses Windows, so he goes to https://www.gpg4win.org to download GPG4Win, a Windows implementation of the PGP cryptography system.
After the installation is complete, launch the key manager for GPG4Win, Kleopatra. Click "File > New Certificate" to create your key. You want a personal OpenPGP key pair. Then it's pretty much the same process with Mac but it's necessary to enter an email address to this one so if you wish to stay anonymous just enter a fake one.
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_01.jpg]](http://s12.postimg.org/e7rs9v6bd/Virtual_Box_Windows_10_04_02_2016_01_12_01.jpg)
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_03.jpg]](http://s12.postimg.org/z77w1d7zt/Virtual_Box_Windows_10_04_02_2016_01_12_03.jpg)
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_08.jpg]](http://s12.postimg.org/vdefs7qnt/Virtual_Box_Windows_10_04_02_2016_01_12_08.jpg)
In this guide I'll tell you about PGP. PGP stands for Pretty Good Privacy and it's pretty good. It is a software program created in 1991 to encrypt and decrypt e-mail messages, but it has come a long way since then. Today it's almost an industry standard in this field with multiple open source implementations based on the same principles. If you send and receive emails containing sensitive and confidential information, update the software on your iPhone or buy drugs with bitcoins on the Deep Web, this is what keeps your data safe. It primarily uses the RSA algorithm, which is based on the principle of Asymmetric Cryptography.
What is asymmetric cryptography?
Simply put; if you have a safe and a key to lock and unlock it, you use the one key to both lock and unlock the safe and this is called symmetric cryptography. However, if you have a safe, a key that can only lock it, and another key that can only unlock it, this is asymmetric cryptography. You unlock the safe, make duplicates of the locking key and hand it out to other people. They lock it with the lock key and ship the safe back to you. You then unlock it and read the contents with the unlock key that you share with no one.
In RSA the lock key is called a Public Key and the unlock key is called a Private Key -- or sometimes a secret key. You give your public key to anyone that wishes to contact you privately. Under no circumstances should you ever give out the private key to anyone.
If you own the private key you can generate the public key from it. If you only have the public key, you can not use it to generate the private key. Technically you can, but you, everyone else in the universe and the universe itself will die before you can crack it with 21st century computing power.
This is all the theory you need to know. I'll give a quick tutorial on how you put this all into practice. I'll explain it for Windows and Mac OS X operating systems. If you use Linux you're probably tech savvy enough to figure this out yourself so I won't go into that.
So I'm the Thing. I want to communicate with another person privately. I use a Mac, so I go to https://gpgtools.org and download GPG Tools. Download and install it. Right after the installation it'll ask you to create a public/private key pair. Put in your name and create one. If you miss it, you can create one after you launch the newly installed key manager GPG Keychain afterwards by going to the menu option File > New Key. It'll look something like this:
![[Image: newkey.jpg]](http://s7.postimg.org/rds3sk73r/newkey.jpg)
You only need to fill in your name. If you wish to give this key out publicly and stay anonymous, don't give your real e-mail address, or better yet, don't give any email address at all, since your public key will include your email address. You can set a passphrase to lock the private key even further but if you forget the passphrase you lose the private key and by extension, the public key associated with it.
You created your key pair? Good. Right click on it and go to Details, it'll look something like this:
![[Image: Screen_Shot_2016_02_04_at_1_04_59_AM.jpg]](http://s7.postimg.org/av4czqjnb/Screen_Shot_2016_02_04_at_1_04_59_AM.jpg)
You can see that it's an RSA key, I have both the public and private keys for this pair and it's a 4,096 bit key. More bits mean more security, every single bit doubles the difficulty of cracking it by brute force. Now I should give the public key out to people. Right click on Export to save it anywhere you want. If you email the key you can leave it as is, but I'll copy and paste it to places so I append .txt to the file name in order to make it open in a text editor when I double click the file.
![[Image: Screen_Shot_2016_02_04_at_1_17_36_AM.jpg]](http://s7.postimg.org/65efb4smv/Screen_Shot_2016_02_04_at_1_17_36_AM.jpg)
![[Image: Screen_Shot_2016_02_04_at_1_18_14_AM.jpg]](http://s7.postimg.org/ec6f2pipj/Screen_Shot_2016_02_04_at_1_18_14_AM.jpg)
![[Image: Screen_Shot_2016_02_04_at_1_18_29_AM.jpg]](http://s7.postimg.org/bjd7ioid3/Screen_Shot_2016_02_04_at_1_18_29_AM.jpg)
Double click the file to open it in a text editor. It's a bunch of characters representing my public key:
![[Image: Screen_Shot_2016_02_04_at_1_18_42_AM.jpg]](http://s7.postimg.org/6ojikek1j/Screen_Shot_2016_02_04_at_1_18_42_AM.jpg)
I'll PM this key to a guy who wishes to engage in a secure PM conversation with me. He uses Windows, so he goes to https://www.gpg4win.org to download GPG4Win, a Windows implementation of the PGP cryptography system.
After the installation is complete, launch the key manager for GPG4Win, Kleopatra. Click "File > New Certificate" to create your key. You want a personal OpenPGP key pair. Then it's pretty much the same process with Mac but it's necessary to enter an email address to this one so if you wish to stay anonymous just enter a fake one.
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_01.jpg]](http://s12.postimg.org/e7rs9v6bd/Virtual_Box_Windows_10_04_02_2016_01_12_01.jpg)
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_03.jpg]](http://s12.postimg.org/z77w1d7zt/Virtual_Box_Windows_10_04_02_2016_01_12_03.jpg)
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_08.jpg]](http://s12.postimg.org/vdefs7qnt/Virtual_Box_Windows_10_04_02_2016_01_12_08.jpg)
![[Image: Virtual_Box_Windows_10_04_02_2016_01_12_24.jpg]](http://s12.postimg.org/b276jnnp5/Virtual_Box_Windows_10_04_02_2016_01_12_24.jpg)
“Our great danger is not that we aim too high and fail, but that we aim too low and succeed.” ― Rollo Tomassi