Advertisement
Guest User

gpg on mac / linux

a guest
Jul 22nd, 2012
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.02 KB | None | 0 0
  1. [MAC]
  2. First download this installer https://www.gpgtools.org/installer/index.html
  3. Install
  4. Go>Terminal
  5.  
  6. [Linux]
  7. Depending on your distro and your install settings you may already have it if you want to check go to the "How to Check" Section
  8. If you do not have it then go to www.gnupg.org and download it or use apt-get / yum or just go to System>Admin>Add/Remove Software
  9. To be honest if you are reading this for linux then you should at least know how to install something
  10.  
  11. [How to Check]
  12. type: "gpg --help" without the quotes into terminal / shell or what ever the ur computer calls it
  13. If you see a really long list of help commands and it says "Please report bugs to <http://bugs.gnupg.org>." at the bottom then proceed down to the bottom
  14.  
  15. Ok so now we have a working gpg and I know this may annoy some of you because you want an easy to use interface and on mac I think gpg tools includes one but I am just going to tell you the easier way, and thats the way I do it on linux. You do have to learn a few commands but really you can just save this into a txt file and do it or well you could actually learn something thats worth the time to learn...
  16. Here are the break down on the next sections
  17. Creating The Message - I am going to show you how to make the text file your going to encrypt without leaving the window your in
  18. Importing Public Keys - This allows you to import / use a "public pgp key" that you see on the internet or in an email
  19. Encrypting A Message - Using the already imported public key we will encrypt a message to give to the person that owns the key
  20.  
  21. [Creating the Message]
  22.  
  23. Use one of the commands to test which text app is installed on your computer if you do not already know.( you can do this in a notepad or something but since your learning you may as well keep it up)
  24. Command:"which ????" where ???? is replaced by either nano or pico (example "which nano" again you only type whats in the quotes)
  25. The which command searches your active path directories for the application in the example nano if you are running a Mac nano will be on there by default so thats why I put it first but some linux users do not have nano they have pico but its the exact same thing.
  26. So to recap what we just learned you are going to be using either "nano" or "pico" to open a txt file so lets try it out now. (I am going to use nano from here on out but you should type pico if you don't have nano)
  27.  
  28. *The following is not needed but I would suggest it. Create a new directory and put all of the files we are going to be dealing with into one spot. to do that Type "mkdir foldername" where foldername is a foldername that is not already taken. then "cd foldername"
  29.  
  30. Use this command: "nano message"
  31. This will open a window inside the terminal / shell application with a window that looks like this, you can type anything you want into it and then use the commands at the bottom to save or exit the ^ stands for contrl. For our purposes today we will just be using the ^X button because it will ask you to save, what to save as and then exit back to where we were.
  32. So if you are following along like you should, then just go ahead and type in your name / address like in the following example
  33.  
  34. John Doe
  35. 1234 Main St
  36. Linux, PC 11111
  37. USA
  38.  
  39. Then just hit control+X(not actually hitting the plus button)
  40. If you want to verify that it saved correctly and has what it should have then type "cat message" and it will display the text you put into the message.
  41. If there are any questions please respond back to me.
  42.  
  43. [Importing Public Keys]
  44. Let us assume 2 things, you know how to "copy and paste" and that you are dealing with a person named "bob"
  45. command:"nano bob.key" <- The file name I used here is completely made up and can and could be anything but once you start doing this often you will want to keep the pgp keys saved that way you do not have to redo this over and over. It also doesnt ahve to end in key or anything at all I could have typed nano fuckyoudumbasslearntogoogle
  46. Once you are inside just go ahead and paste the public key from the website it should look something like this
  47.  
  48. -----BEGIN PGP PUBLIC KEY BLOCK-----
  49. Version: GnuPG v1.0.6 (GNU/Linux)
  50. mQGiBDv2vMARBACPHwe3BXmJXF5dvXxGEuxYIbYoY2naOmaArFsv1Pgl3GqhhAP7 GTGvN4A4Xo80S8i8mrSsseHE/RD7F2PS045dzP/LbDcI7EqnfU2BDoIfEmTsTupl BKjOJUh7luhFbj2gdpbmmTUD/1BBKd42pIk/GPUcynMS9TG4kUyB6UdtRF7NydYP o4T+0fIY8mbh5VRigoVVsukX8xuI+QaS5iB/D4j36+zk/iRy171dY43OuwCgm6rQ a8vmmGDyCCUWFX0PVlQn5MMf97GadIAGgh1pdD7bMfB4FI84TyhNHuBDTCn0Ysff not_a_public_key_but_other_than_this_line_it_looks_like_this_xxx bRmMA/9E/EGJnyYWdHtTerx+H8qacP183SrRFQDqSkOM61P4iDIWcZCOqlHCv7Br Rmf7Ug9I4RkD5qqWkpWY0ugcSbuoFx0f7AGckOOWWVq4ddQStAsOhlMQ4ahOu7mB cmVuY2UgKExpbmRhJ3MgR1BHIGtleSBwYWlyKSA8bGluZHlAcGN1bml4LmNvbT6I dVJeXzVTKHnMTGUqutPpmro/txW3M4Z3/0gsOGySxlob0MOQcbQ4TGluZGEgTGF3 VwQTEQIAFwUCO/a8wQULBwoDBAMVAwIDFgIBAheAAAoJEAymPu375boq1fkAniuK EAQAj8E9riM9UUI2fc3Of/5khuEi2nbT2xD2//FUVQh4uKXd4iQXW3z55ZbJnJ1E Nk6xIPHx0kQUEcUxdRSK0rikAJ9bB4o+oZ9wqJubKMHII1K1BunTuLkBDQQ79rzF bZ+TGMKFOgoxEGAeIcf/XD0/zRDOvdKuLsIZjlNl3uqChXgeznCFU4kviuGdSeDK vcx/cR7NgfAn2JUKnhcf/sf01WRM43TbSZP5+5ZXk7zZWZItp+STRHYUketXwFk/ LWn2jrjbFpcBswgXZ1Vq7Hrbi027y4x6KIhKZ0rfGsXDYxsAAwUD/jCF25xvDrU9 W5mjSmWy1f+Hn5q/RQAChIAgEEwWMpaHLXixyI+xE+kXvowDYdbmQWruJS1BGKDF /JibHwSp15ZzGQivpX/Dul4/nks3xYy7iEYEGBECAAYFAjv2vMUACgkQDKY+7fvl uiqY4ACcCga6MsB3DhSLEO6Fse09UujGwUMAmwY9skYtEZDAFXBlcpov1wYzFAhh
  51. -----END PGP PUBLIC KEY BLOCK-----
  52.  
  53. And then hit control+X to save and exit
  54. Type: "gpg --import bob.key" it will tell you it successfully imported some key(the key I used above I just googled for gpg key example so i have no idea if its real it was just the first one I found)
  55. To verify type:"gpg --list-keys" you should see a name there and just remember what it is typically for what this subreddit will be using it for it will be fake like "bob@tormail.org bob bobby"
  56.  
  57. [Encrypting a Message]
  58. So we are going to assume 2 things this time, you have imported a public key and you have made the message containing your address that you want to encrypt
  59. To encrypt type this:"gpg -ae -r bob message > message.bob.txt"
  60. Hit Y for yes if asked if it is ok about anything if it says name not found you need to scroll down to where it says -r and make sure you typed the person in correctly from gpg --list-keys
  61. I am going to break this down part by part for you
  62. -a makes it ascii armored so we can send it via email or internet
  63. -e encrypts the file
  64. -r selects which reciepient ( you can leave out "-r bob" and it will let you type it in manually if you want but it doesn't have be the whole name I could have used bo as long as there was only one that matched that search)
  65. message this is the file we want to encrypt so it is required
  66. > message.bob.txt outputs the file to message.bob.txt you can change it to what ever you want or not include the "> message.bob.txt" at all and it will output to bob.key.asc
  67.  
  68. I was going to include pictures but I literally just spent an hour doing this for people I typically think should learn to use on their own so you just get a wall of text while I go watch breaking bad.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement