diff --git a/2 b/2 new file mode 100644 index 0000000..2f51542 --- /dev/null +++ b/2 @@ -0,0 +1,315 @@ +--- +title: How To Encrypt Your Own Documents Using gpg +layout: post +author: tait +--- + +If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds. + +If you have never used Linux however, then the method of doing this will be rather unfamiliar. +This tutorial will be done on an [Arch Linux](https://archlinux.org/) machine, +but it should be the same on Ubuntu, Fedora, CentOS, Debian, +OpenBSD, FreeBSD, MacOSX, etc. +The only operating system that does not include these tools by default (or easily accessible) is Windows. + +*Let us...begin!* + +## Glossary + +* [**ASCII armour**](https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor) --- A way to encode **OpenPGP** documents so they are readable by humans. These files end in .asc +* **(Open)PGP** --- An open standard for encoding pulbic keys and encrypted documents. +* **GPG** --- GNUPrivacyGaurd is an implementation of **OpenPGP**. It is installed by default on most Linux distrobutions. + +## Step 0: Setup + +We will be using the utility `gpg` for this tutorial. + +The other thing to note: The character '$' (dollar sign) is usually not typed when shown in a command. +It simply indicates that you do not need administrative privilages to run these commands. + +Test to see if you get this output in your terminal. + +
+$ gpg --version
+
+gpg (GnuPG) 2.2.20
+libgcrypt 1.8.5
+Copyright (C) 2020 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later 
+
+...
+
+ +If this is not successful look into how to install these tools on your system. + +## Step 1: Get/Create A Public Key! + +### Get Somebody Else's +Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower. + +To encrypt a document with somebody's public key, you need to first obtain it. +My public key is available [at this link](/public-key.asc), and you can use it to send me encrypted stuff. + +If you are on a linux terminal, you can use the `curl` or `wget` command to download it. + +wget: +
+$ wget https://tait.tech/public-key.asc
+
+ +Curl: +
+$ curl https://tait.tech/public-key.asc -o public-key.asc
+
+ +### Make Your Own (optional) + +The following section is quite long, +so if you don't want to create your own keypair, +then feel free to skip to [Step #2](#step-2-import-public-key). + +If you want to encrypt your own documents, +or you want others to be able to send you encrypted messages, +then you can create your own public/private key pair. +You can use these to encrypt your documents, +and you can send our public key to others so that they can securely communicate with yourself. + +Run the following command in your terminal, and follow the steps I outline to get you started. + +
+$ gpg --full-gen-key
+
+ +This will produce the following dialog: + +
+gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Please select what kind of key you want:
+  (1) RSA and RSA (default)
+  (2) DSA and Elgamal
+  (3) DSA (sign only)
+  (4) RSA (sign only)
+  (14) Existing key from card
+Your selection? 
+
+ +Select the option `1`. You want two keys, both RSA. + +Next we will select the key size: +
+RSA keys may be between 1024 and 4096 bits long.
+What keysize do you want? (2048) 
+
+ +Type the number 2048. + +Next it will ask you how long you want the key to be valid. + +
+Requested keysize is 2048 bits
+Please specify how long the key should be valid.
+          0 = key does not expire
+       <n>  = key expires in n days
+       <n>w = key expires in n weeks
+       <n>m = key expires in n months
+       <n>y = key expires in n years
+Key is valid for? (0)
+
+ +Type the number 1. This will enable you time to test it, +but it will make the key expire within 24 hours so that if you accidentally +share your private key, or delete your VM and no longer have access to it, you will be fine. + +It will ask your if you are sure about the expiry date. + +
+Key expires at Tue Apr  7 02:24:23 2020 UTC
+Is this correct? (y/N) 
+
+ +Type `y` to confirm your choice. + +Now `gpg` is going to ask you to create a user id to indetify this key. +Use some test data for now. +User input is in bold, feel free to follow along or to put your own test data in. + +Once you are more comfortable with the tools, +then you can create a public/private keypair that you will keep for some time. + +
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Mr. Tester
+Email address: test@test.org
+Comment: for testing only
+You selected this USER-ID:
+    "Mr. Tester (for testing only) "
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
+
+ +It will then ask you for a password. +If you are simply using this for test purposes, +then you can feel free to set it to something like "test". +When create a long-term use pulbic key make sure to make the password *very* secure. + +During the process of creating your key, `gpg` may warn you with this message: + +
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+ +If this happens, feel free to smash your keyboard (lightly), +watch a YouTube video on the machine, +browse the web with [w3m](http://w3m.sourceforge.net/), +etc. until the key is generated. + +You will know it is done when you see this message (or something similar): + +
+gpg: key EACCC490291EA7CE marked as ultimately trusted
+gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
+public and secret key created and signed.
+
+pub   rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
+      FFA7D7525C6546983F1152D8EACCC490291EA7CE
+      uid                      Mr. Tester (for testing only) 
+      sub   rsa2048 2020-04-06 [E] [expires: 2020-04-07]
+
+ +Tada! You have your own public/private keypair! + +Sharing a keypair that will expire soon is not a good idea, +however, if you are ready, then you can use this command to generate a public key file to share with others. + +Feel free to substitute "Mr. Tester" for any other identifying part of your key. +Remember that to use the email, you must enclose it in < and >. + +
+$ gpg --export --armour "Mr. Tester" > public-key.asc
+
+ +To use the email as the identifier: +
+$ gpg --export --armour "" > public-key.asc
+
+ +## Step 2: Import Public Key + +This list of keys that `gpg` keeps on tap so to speak, is called our "keyring". +Your will need to import a new public key to encrypt files with `gpg`. + +If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :) + +
+ A keyring holding eight allen keys. +
+ A keyring holding eight allen keys. +
+
+ +To import a public key to use for encrypting files, use the `--import` option of `gpg`. Like so: + +
+$ gpg --import public-key.asc
+gpg: key 64FB4E386953BEAD: public key "Tait Hoyem " imported
+gpg: Total number processed: 1
+gpg:               imported: 1
+
+ +Now that we have imported a public key, we can make a message to send! + +## Step 3: Have A Message To Encrypt + +We can make a new file which holds some important, secret data. +Feel free to use a graphical editor if you have one, if not, `nano` works alright too. +Feel free to encrypt this and send it to me to see if it works! + +
+  Rules Of A Good Life:
+
+  1. Wash your hands!
+  2. Work hard!
+  3. Be firm.
+  5. Have good friends!
+
+ +Save this file as something like `test-pgp.txt`, and we'll use that name later :) + +## Step 4: Encrypt A Message + +Now that we have a message to send and person to send to, +all we have to do is encrypt this message and it'll be on its merry way! +To do so, we must specify two new options to `gpg`. + +The first is `--recipient`. +This tells `gpg` to encrypt using a certina public key that we have in our keyring. +We can use the person's name, email address, or the key's uid. + +The second is `--encrypt`. +Put the file name after this option. + +We will also specify the `--armour` option to use ASCII armoured files. + +### On With It! + +Ok, yes! +Let's encrypt our document now. + +We will be using my name to identify the key. +In the very strange case you have two keys in your keyring named after me, this will fail... +But at that point I have other questions. + +This is the big one! + +
+$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt
+
+ +"But there is no output!" you might say! +Yes, that is because our new (encrypted) file has already been saved. +Let's look at it with cat. + +
+$ cat test-gpg.txt.asc
+-----BEGIN PGP MESSAGE-----
+
+hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
+XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
+0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
+Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
+MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
+079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
+p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
+Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
+0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
+cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
+9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
+mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
+bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
+jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
+nv117moLfK22Mst/
+=bw8T
+-----END PGP MESSAGE-----
+
+ +## Step 5: Finale! + +Ladies and gentleman, we have done it! +We have encrypted our very own document. + +Feel free to send it to [my email (tait@tait.tech)](mailto:tait@tait.tech). +I am happy to verify if it worked. + +For more information on this subject, check out [gnugp.org's guide](https://www.gnupg.org/gph/en/manual/c14.html) on using GPG. +They are the ones that make these tools available, +and the [GNU Project](https://www.gnu.org/) has been instrumental in creating the open-source world as it exists today. + diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..5e0ea02 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,2 @@ + diff --git a/_layouts/post.html b/_layouts/post.html index caf3bc9..06d3c61 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -7,3 +7,5 @@ layout: default
{{ content }}
+ +{% include footer.html %} diff --git a/_posts/2020-04-02-rsa3.md b/_posts/2020-04-02-rsa3.md new file mode 100644 index 0000000..4dd28ce --- /dev/null +++ b/_posts/2020-04-02-rsa3.md @@ -0,0 +1,146 @@ +--- +title: "How Asymetric Encryption Works" +layout: post +author: tait +--- +In a few previous articles I have explained [why encryption may be important to you](/2020/01/26/rsa1.html) and [how the theory behind encryption works](/2020/02/19/rsa2.html). I did not yet explain the system of asymetric cryptography, however. That is what this article is for. + +Previously, we talked about how *symetric* encryption works. This is by having a shared key that both parties use to simultaniously encrypt, and decrypt the data. (See Ceasar Cipher for example). + +## Public-key, or Asymetric Encryption + +Asymetric encryption is based on the idea of having multiple keys instead of only one shared key. +For example: instead of encrypting with one key, and decrypting with that same key (like our ROT ciphers we talked about previously), we can use one key to *encrypt* the information, and a different key to *decrypt* the information. + +
+ Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key. +
+ Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key. +
+
+ +In the picture above, see how Alice uses Bob's public key to encrypt some data, +then sends it to Bob for him to decrypt with his private key? +That is the essense of public-key encryption. + +The great thing about public-key encryption is that your public key is *public*! There is no need to be afraid of sending this everywhere! +You can attach it at the end of all your emails, the end of your forum posts, [a link to it on your low-power webserver](/public-key.asc) (wink). +There are even things called [keyservers](http://keys.gnupg.net/) that will save your public key on them for retrival in case somebody wants to verify your public key. + +Anything encrypted with your public key can only be decrypted with your private key. +Provided you never, *NEVER* share your private key with anyone ever, we can assume that all messages sent to you encrypted with your public key will never be read by anyone else. + +Asymetric encryption, however, often contains four keys instead of two. Why is this? + +#### Verification of Author + +One interesting thing about keys pairs is that not only can the private key decrypt anything the public key encrypts, +but the public key can decrypt anything the private key encrypts. + +Now why would one want to encrypt a message that can be decrypted by anyone? + +
+ Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it! +
+ Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it! +
+
+ Note: Although the picture shows otherwise, the text is not sent in the plain. It is encrypted with Alice's private key. +
+
+ +This is how you can verify that the person who says they wrote the message really did indeed write the message! +If their private key was never shared with anyone else, then the message must have come from them! + +For maximum security, these methods are often layered. +First, signing with the sender's private key, +ensuring only they could have sent it--- +then encrypted with the recipient's pulbic key, +making sure only the reciever can read it. + +Note that both sides must first have eachother's public keys to do this. +This is easy if they communicate often, but when first contacting somebody, +people will generally send their encrypted message along with the their own pulbic key attached in a seperate file. + +### What This Means + +Notice neither Alice nor Bob had to share any comprimsing information over the network? +This is why public-key encryption is so powerful! + +Alice and Bob can both safely send their public keys in the open. +They can even send them over the insecure HTTP, or FTP protocols. + +Whilst not sending any encryption-breaking messages, +Alice and Bob now have a way to communicate securely. +If you trust nothing and no one, this is your perfered method of security. + + +Check out this [Computerphile video](https://www.youtube.com/watch?v=GSIDS_lvRv4) if you want the simplified explaination. + +### The Algorithms + +The two biggest "implementations" of public-key cryptography vary only in the mathamatical equations used to generate the numbers, +and how the numbers are ["trapdoored"](https://en.wikipedia.org/wiki/Trapdoor_function) to decrypt if you have the correct key. + +I will discuss the differences in approach here. +If you want to skip to the next article where I show you how to encrypt your own documents using RSA, see [this link](/2020/04/06/rsa4.html). + +### RSA + +The mathamatic center of the RSA system was developed over the course of a year or so. +Three men were involved. Ron Rivest, Adi Shamir, and Leonard Aldeman. +They worked as a kind of "team": Each idea by Rivest and Shamir were critisized by the mathamatician on their team: Mr. Aldeman. + +One night, after consuming +["liberal quantities of Manischewitz wine"](https://www.math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALAPP/Calderbank.pdf) +Rivest had trouble sleeping. +After taking long gazes into the abyss of his math textbook, he came up with an idea which would change cryptography forever. +By the next morning, an academic mathamatical paper was nearly finished. +He named it after himself and the two others that had been helping him along this whole time. *Rivest, Shamir, Aldeman*. + +Key sizes of RSA range from 1024-bit to 4096-bit. +1024-bit keys are considered somewhat insecure. +However, +it should be noted that every bit doubles the complexity of the key, +so 2048 is [2^1024](https://www.wolframalpha.com/input/?i=2%5E1024) times more complex than 1024. + +### Eliptic-Curve (EC) + +Eliptic-Curve (EC) is a family of algorithms that use the [Eliptic curve](https://en.wikipedia.org/wiki/Elliptic_curve) mathamatical structure to generate the numbers for the keys. +EC can effectivly provide the security of an RSA key [one order of magnitude larger](https://www.youtube.com/watch?v=NF1pwjL9-DE) than an RSA key. + +
+ A picture of an eliptic curve. +
+ An eliptic curve structure. +
+
+ +It's fast; it's secure! Perfect right? + +Of course not! + +One problem is that due to the smaller key size, +it can more easily be broken by brute-force. +This is why EC is mostly used for temporary communication (like HTTPS), not permenant communication (like having an encrypted email conversation with a journalist). + +The other problem is that a certain EC algrorithm called P-256 is suspected to be introduced with malice to National Institute of Standards and Technology (NIST) +[by the NSA](https://www.schneier.com/essays/archives/2007/11/did_nsa_put_a_secret.html). +Supposedly, the NSA is able to crack anything encrypted with this algorithm. +I will let the experts argure about that. + +Other well-known EC algorithms that are more-or-less trusted as secure do exist though. +The premeire one being Curve25519. +The reference implementation of [this algrorithm](https://cr.yp.to/ecdh.html) is also [public-domain](https://fairuse.stanford.edu/overview/public-domain/welcome/), +so it is easy for devlopers to work into their own applications without worrying about copywrite. + +## Conslusion + +In this article we went over some basic points: + +1. Public-key encryption enables secure communication over insecure networks. +2. RSA is considered the standard for extra-seure communication. +3. EC is a newer, faster, more transient encryption method. + +To learn how to use RSA keys to encrypt your own communications, check out [this other aritcle I wrote](/2020/04/06/rsa4.html). + diff --git a/_posts/2020-04-06-rsa4.md b/_posts/2020-04-06-rsa4.md new file mode 100644 index 0000000..453bfa6 --- /dev/null +++ b/_posts/2020-04-06-rsa4.md @@ -0,0 +1,345 @@ +--- +title: How To Encrypt Your Own Documents Using gpg +layout: post +author: tait +--- + +If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds. + +If you have never used Linux however, then the method of doing this will be rather unfamiliar. +This tutorial will be done on an [Arch Linux](https://archlinux.org/) machine, +but it should be the same on Ubuntu, Fedora, CentOS, Debian, +OpenBSD, FreeBSD, MacOSX, etc. +The only operating system that does not include these tools by default (or easily accessible) is Windows. + +This tutorial makes heavy use of the terminal. +You have been warned. + +*Let us...begin!* + +## Glossary + +* [**ASCII armour**](https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor) --- A way to encode **OpenPGP** documents so they are readable by humans. These files end in .asc +* **(Open)PGP** --- An open standard for encoding pulbic keys and encrypted documents. +* **GPG** --- GNUPrivacyGaurd is an implementation of **OpenPGP**. It is installed by default on most Linux distrobutions. + +## Step 0: Setup + +We will be using the utility `gpg` for this tutorial. + +The other thing to note: The character '$' (dollar sign) is usually not typed when shown in a command. +It simply indicates that you do not need administrative privilages to run these commands. + +Test to see if you get this output in your terminal. + +
+$ gpg --version
+
+gpg (GnuPG) 2.2.20
+libgcrypt 1.8.5
+Copyright (C) 2020 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later 
+
+...
+
+ +If this is not successful look into how to install these tools on your system. + +## Step 1: Get/Create A Public Key! + +### Get Somebody Else's +Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower. + +To encrypt a document with somebody's public key, you need to first obtain it. +My public key is available [at this link](/public-key.asc), and you can use it to send me encrypted stuff. + +If you are on a linux terminal, you can use the `curl` or `wget` command to download it. + +wget: +
+$ wget https://tait.tech/public-key.asc
+
+ +Curl: +
+$ curl https://tait.tech/public-key.asc -o public-key.asc
+
+ +### Make Your Own (optional) + +The following section is quite long, +so if you don't want to create your own keypair, +then feel free to skip to [Step #2](#step-2-import-public-key). + +If you want to encrypt your own documents, +or you want others to be able to send you encrypted messages, +then you can create your own public/private key pair. +You can use these to encrypt your documents, +and you can send our public key to others so that they can securely communicate with yourself. + +Run the following command in your terminal, and follow the steps I outline to get you started. + +
+$ gpg --full-gen-key
+
+ +This will produce the following dialog: + +
+gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Please select what kind of key you want:
+  (1) RSA and RSA (default)
+  (2) DSA and Elgamal
+  (3) DSA (sign only)
+  (4) RSA (sign only)
+  (14) Existing key from card
+Your selection? 
+
+ +Select the option `1`. You want two keys, both RSA. + +Next we will select the key size: +
+RSA keys may be between 1024 and 4096 bits long.
+What keysize do you want? (2048) 
+
+ +Type the number 2048. + +Next it will ask you how long you want the key to be valid. + +
+Requested keysize is 2048 bits
+Please specify how long the key should be valid.
+          0 = key does not expire
+       <n>  = key expires in n days
+       <n>w = key expires in n weeks
+       <n>m = key expires in n months
+       <n>y = key expires in n years
+Key is valid for? (0)
+
+ +Type the number 1. This will enable you time to test it, +but it will make the key expire within 24 hours so that if you accidentally +share your private key, or delete your VM and no longer have access to it, you will be fine. + +It will ask your if you are sure about the expiry date. + +
+Key expires at Tue Apr  7 02:24:23 2020 UTC
+Is this correct? (y/N) 
+
+ +Type `y` to confirm your choice. + +Now `gpg` is going to ask you to create a user id to indetify this key. +Use some test data for now. +User input is in bold, feel free to follow along or to put your own test data in. + +Once you are more comfortable with the tools, +then you can create a public/private keypair that you will keep for some time. + +
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Mr. Tester
+Email address: test@test.org
+Comment: for testing only
+You selected this USER-ID:
+    "Mr. Tester (for testing only) "
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
+
+ +It will then ask you for a password. +If you are simply using this for test purposes, +then you can feel free to set it to something like "test". +When create a long-term use pulbic key make sure to make the password *very* secure. + +During the process of creating your key, `gpg` may warn you with this message: + +
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+ +If this happens, feel free to smash your keyboard (lightly), +watch a YouTube video on the machine, +browse the web with [w3m](http://w3m.sourceforge.net/), +etc. until the key is generated. + +You will know it is done when you see this message (or something similar): + +
+gpg: key EACCC490291EA7CE marked as ultimately trusted
+gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
+public and secret key created and signed.
+
+pub   rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
+      FFA7D7525C6546983F1152D8EACCC490291EA7CE
+      uid                      Mr. Tester (for testing only) 
+      sub   rsa2048 2020-04-06 [E] [expires: 2020-04-07]
+
+ +Tada! You have your own public/private keypair! + +Sharing a keypair that will expire soon is not a good idea, +however, if you are ready, then you can use this command to generate a public key file to share with others. + +Feel free to substitute "Mr. Tester" for any other identifying part of your key. +Remember that to use the email, you must enclose it in < and >. + +
+$ gpg --export --armour "Mr. Tester" > public-key.asc
+
+ +To use the email as the identifier: +
+$ gpg --export --armour "" > public-key.asc
+
+ +## Step 2: Import Public Key + +This list of keys that `gpg` keeps on tap so to speak, is called our "keyring". +Your will need to import a new public key to encrypt files with `gpg`. + +If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :) + +
+ A keyring holding eight allen keys. +
+ A keyring holding eight allen keys. +
+
+ +To import a public key to use for encrypting files, use the `--import` option of `gpg`. Like so: + +
+$ gpg --import public-key.asc
+gpg: key 64FB4E386953BEAD: public key "Tait Hoyem " imported
+gpg: Total number processed: 1
+gpg:               imported: 1
+
+ +Now that we have imported a public key, we can make a message to send! + +## Step 3: Have A Message To Encrypt + +You can make a new file which holds some important, secret data. +Feel free to use a graphical editor if you have one, if not, `nano` works alright too. + +
+  Rules Of A Good Life:
+
+  1. Wash your hands!
+  2. Work hard!
+  3. Be firm.
+  5. Have good friends!
+
+ +Save this file as something like `test-pgp.txt`, and we'll use that name later. + +## Step 4: Encrypt A Message + +Now that we have a message to send and person to send to, +all we have to do is encrypt this message and it'll be on its merry way! +To do so, we must specify two new options to `gpg`. + +The first is `--recipient`. +This tells `gpg` to encrypt using a certin public key that we have in our keyring. +You can use the person's name, email address, or the key's uid. + +The second is `--encrypt`. + +You will also specify the `--armour` option to use ASCII armoured files. Put this option after `--encrypt`, and put the file name after `--armour`. See below. + +You can either use your own public key name to encrypt a document (allowng only you to decrypt it), +or you can use my public key that we imported earlier (allowing only me to decrypt it). +Either way works fine. + +This is the big one! + +
+$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt
+
+ +"But there is no output!" you might say! +Yes, that is because our new (encrypted) file has already been saved. +Let's look at it with cat. + +
+$ cat test-gpg.txt.asc
+-----BEGIN PGP MESSAGE-----
+
+hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
+XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
+0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
+Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
+MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
+079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
+p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
+Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
+0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
+cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
+9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
+mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
+bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
+jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
+nv117moLfK22Mst/
+=bw8T
+-----END PGP MESSAGE-----
+
+ +## Step 5: Decryption (optional) + +If you created your own public/private keypair in step 1, +and you encryped using `--recipient "Your Test Name"`, +then you can decrypt your document as well! + +You will need to specify `--decrypt`, and that's all folks! + +
+$ gpg --decrypt test-gpg.txt.asc
+
+ +A password dialog will then come up asking for your previously created password. +As long as you remember your password from before and enter it correctly: voila! + +
+gpg: encrypted with 4096-bit RSA key, ID 6989B986FCBE4225, created 2020-01-02
+      "Tait Hoyem "
+Rules Of A Good Life:
+
+1. Wash your hands!
+2. Work hard!
+3. Be firm.
+5. Have good friends!
+
+ +## Step 6: Finale! + +Ladies and gentleman, you have done it! +You have encrypted our very own document. +(And maybe even decrypted it yourself too :) + +If you encrypted using my public key, +feel free to send it to [my email](mailto:tait@tait.tech). +I am happy to verify if it worked. + +For more information on this subject, check out [gnugp.org's guide](https://www.gnupg.org/gph/en/manual/c14.html) on using GPG. +They are the ones that make these tools available, +and the [GNU Project](https://www.gnu.org/) has been instrumental in creating the open-source world as it exists today. +Give 'em some love, eh! + +Thank you so much for sticking through this whole thing! +Let me know if there is anything that doesn't make sense. +I am happy to improve this guide as time goes on if that is necessary. + +Happy hacking :) diff --git a/_sass/main.scss b/_sass/main.scss index 5b7a079..1ed42f9 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -209,3 +209,21 @@ figcaption { font-size: .8em; text-decoration: italic; } + +footer { + border-top: $line-under; + margin-bottom: 100px; +} + +.terminal { + line-height: 1em; + overflow: scroll; + padding: 10px; + color: #00FF41; + margin: 0px; + background-color: #151515; +} + +.small-image { + width: 100%; +} diff --git a/_site/2 b/_site/2 new file mode 100644 index 0000000..26ccb5f --- /dev/null +++ b/_site/2 @@ -0,0 +1,349 @@ + + + + + How To Encrypt Your Own Documents Using gpg + + + + +
+ + +

How To Encrypt Your Own Documents Using gpg

+

+ +
+ If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds. + +If you have never used Linux however, then the method of doing this will be rather unfamiliar. +This tutorial will be done on an [Arch Linux](https://archlinux.org/) machine, +but it should be the same on Ubuntu, Fedora, CentOS, Debian, +OpenBSD, FreeBSD, MacOSX, etc. +The only operating system that does not include these tools by default (or easily accessible) is Windows. + +*Let us...begin!* + +## Glossary + +* [**ASCII armour**](https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor) --- A way to encode **OpenPGP** documents so they are readable by humans. These files end in .asc +* **(Open)PGP** --- An open standard for encoding pulbic keys and encrypted documents. +* **GPG** --- GNUPrivacyGaurd is an implementation of **OpenPGP**. It is installed by default on most Linux distrobutions. + +## Step 0: Setup + +We will be using the utility `gpg` for this tutorial. + +The other thing to note: The character '$' (dollar sign) is usually not typed when shown in a command. +It simply indicates that you do not need administrative privilages to run these commands. + +Test to see if you get this output in your terminal. + +
+$ gpg --version
+
+gpg (GnuPG) 2.2.20
+libgcrypt 1.8.5
+Copyright (C) 2020 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later 
+
+...
+
+ +If this is not successful look into how to install these tools on your system. + +## Step 1: Get/Create A Public Key! + +### Get Somebody Else's +Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower. + +To encrypt a document with somebody's public key, you need to first obtain it. +My public key is available [at this link](/public-key.asc), and you can use it to send me encrypted stuff. + +If you are on a linux terminal, you can use the `curl` or `wget` command to download it. + +wget: +
+$ wget https://tait.tech/public-key.asc
+
+ +Curl: +
+$ curl https://tait.tech/public-key.asc -o public-key.asc
+
+ +### Make Your Own (optional) + +The following section is quite long, +so if you don't want to create your own keypair, +then feel free to skip to [Step #2](#step-2-import-public-key). + +If you want to encrypt your own documents, +or you want others to be able to send you encrypted messages, +then you can create your own public/private key pair. +You can use these to encrypt your documents, +and you can send our public key to others so that they can securely communicate with yourself. + +Run the following command in your terminal, and follow the steps I outline to get you started. + +
+$ gpg --full-gen-key
+
+ +This will produce the following dialog: + +
+gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Please select what kind of key you want:
+  (1) RSA and RSA (default)
+  (2) DSA and Elgamal
+  (3) DSA (sign only)
+  (4) RSA (sign only)
+  (14) Existing key from card
+Your selection? 
+
+ +Select the option `1`. You want two keys, both RSA. + +Next we will select the key size: +
+RSA keys may be between 1024 and 4096 bits long.
+What keysize do you want? (2048) 
+
+ +Type the number 2048. + +Next it will ask you how long you want the key to be valid. + +
+Requested keysize is 2048 bits
+Please specify how long the key should be valid.
+          0 = key does not expire
+       <n>  = key expires in n days
+       <n>w = key expires in n weeks
+       <n>m = key expires in n months
+       <n>y = key expires in n years
+Key is valid for? (0)
+
+ +Type the number 1. This will enable you time to test it, +but it will make the key expire within 24 hours so that if you accidentally +share your private key, or delete your VM and no longer have access to it, you will be fine. + +It will ask your if you are sure about the expiry date. + +
+Key expires at Tue Apr  7 02:24:23 2020 UTC
+Is this correct? (y/N) 
+
+ +Type `y` to confirm your choice. + +Now `gpg` is going to ask you to create a user id to indetify this key. +Use some test data for now. +User input is in bold, feel free to follow along or to put your own test data in. + +Once you are more comfortable with the tools, +then you can create a public/private keypair that you will keep for some time. + +
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Mr. Tester
+Email address: test@test.org
+Comment: for testing only
+You selected this USER-ID:
+    "Mr. Tester (for testing only) "
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
+
+ +It will then ask you for a password. +If you are simply using this for test purposes, +then you can feel free to set it to something like "test". +When create a long-term use pulbic key make sure to make the password *very* secure. + +During the process of creating your key, `gpg` may warn you with this message: + +
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+ +If this happens, feel free to smash your keyboard (lightly), +watch a YouTube video on the machine, +browse the web with [w3m](http://w3m.sourceforge.net/), +etc. until the key is generated. + +You will know it is done when you see this message (or something similar): + +
+gpg: key EACCC490291EA7CE marked as ultimately trusted
+gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
+public and secret key created and signed.
+
+pub   rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
+      FFA7D7525C6546983F1152D8EACCC490291EA7CE
+      uid                      Mr. Tester (for testing only) 
+      sub   rsa2048 2020-04-06 [E] [expires: 2020-04-07]
+
+ +Tada! You have your own public/private keypair! + +Sharing a keypair that will expire soon is not a good idea, +however, if you are ready, then you can use this command to generate a public key file to share with others. + +Feel free to substitute "Mr. Tester" for any other identifying part of your key. +Remember that to use the email, you must enclose it in < and >. + +
+$ gpg --export --armour "Mr. Tester" > public-key.asc
+
+ +To use the email as the identifier: +
+$ gpg --export --armour "" > public-key.asc
+
+ +## Step 2: Import Public Key + +This list of keys that `gpg` keeps on tap so to speak, is called our "keyring". +Your will need to import a new public key to encrypt files with `gpg`. + +If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :) + +
+ A keyring holding eight allen keys. +
+ A keyring holding eight allen keys. +
+
+ +To import a public key to use for encrypting files, use the `--import` option of `gpg`. Like so: + +
+$ gpg --import public-key.asc
+gpg: key 64FB4E386953BEAD: public key "Tait Hoyem " imported
+gpg: Total number processed: 1
+gpg:               imported: 1
+
+ +Now that we have imported a public key, we can make a message to send! + +## Step 3: Have A Message To Encrypt + +We can make a new file which holds some important, secret data. +Feel free to use a graphical editor if you have one, if not, `nano` works alright too. +Feel free to encrypt this and send it to me to see if it works! + +
+  Rules Of A Good Life:
+
+  1. Wash your hands!
+  2. Work hard!
+  3. Be firm.
+  5. Have good friends!
+
+ +Save this file as something like `test-pgp.txt`, and we'll use that name later :) + +## Step 4: Encrypt A Message + +Now that we have a message to send and person to send to, +all we have to do is encrypt this message and it'll be on its merry way! +To do so, we must specify two new options to `gpg`. + +The first is `--recipient`. +This tells `gpg` to encrypt using a certina public key that we have in our keyring. +We can use the person's name, email address, or the key's uid. + +The second is `--encrypt`. +Put the file name after this option. + +We will also specify the `--armour` option to use ASCII armoured files. + +### On With It! + +Ok, yes! +Let's encrypt our document now. + +We will be using my name to identify the key. +In the very strange case you have two keys in your keyring named after me, this will fail... +But at that point I have other questions. + +This is the big one! + +
+$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt
+
+ +"But there is no output!" you might say! +Yes, that is because our new (encrypted) file has already been saved. +Let's look at it with cat. + +
+$ cat test-gpg.txt.asc
+-----BEGIN PGP MESSAGE-----
+
+hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
+XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
+0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
+Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
+MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
+079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
+p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
+Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
+0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
+cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
+9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
+mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
+bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
+jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
+nv117moLfK22Mst/
+=bw8T
+-----END PGP MESSAGE-----
+
+ +## Step 5: Finale! + +Ladies and gentleman, we have done it! +We have encrypted our very own document. + +Feel free to send it to [my email (tait@tait.tech)](mailto:tait@tait.tech). +I am happy to verify if it worked. + +For more information on this subject, check out [gnugp.org's guide](https://www.gnupg.org/gph/en/manual/c14.html) on using GPG. +They are the ones that make these tools available, +and the [GNU Project](https://www.gnu.org/) has been instrumental in creating the open-source world as it exists today. + + +
+ + + + +
+ + diff --git a/_site/2020-01-23-sql-joins.html b/_site/2020-01-23-sql-joins.html index 9ab1367..d2f8c50 100644 --- a/_site/2020-01-23-sql-joins.html +++ b/_site/2020-01-23-sql-joins.html @@ -191,6 +191,10 @@ + + + diff --git a/_site/2020/01/22/padding-and-margin.html b/_site/2020/01/22/padding-and-margin.html index c407bb3..1f17234 100644 --- a/_site/2020/01/22/padding-and-margin.html +++ b/_site/2020/01/22/padding-and-margin.html @@ -76,6 +76,10 @@ + + + diff --git a/_site/2020/01/26/rsa1.html b/_site/2020/01/26/rsa1.html index 0fb56d7..bfd7371 100644 --- a/_site/2020/01/26/rsa1.html +++ b/_site/2020/01/26/rsa1.html @@ -82,6 +82,10 @@ Japan lags slightly behind with 80 percent encrypted traffic.

+ + + diff --git a/_site/2020/02/19/rsa2.html b/_site/2020/02/19/rsa2.html index c65e2cb..96778b0 100644 --- a/_site/2020/02/19/rsa2.html +++ b/_site/2020/02/19/rsa2.html @@ -174,6 +174,10 @@ I will discuss this more in another article, but for the technically inclined: + + + diff --git a/_site/2020/04/02/rsa3.html b/_site/2020/04/02/rsa3.html new file mode 100644 index 0000000..0183d6d --- /dev/null +++ b/_site/2020/04/02/rsa3.html @@ -0,0 +1,182 @@ + + + + + How Asymetric Encryption Works + + + + +
+ + +

How Asymetric Encryption Works

+

Thursday, April 02 2020

+ +
+

In a few previous articles I have explained why encryption may be important to you and how the theory behind encryption works. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.

+ +

Previously, we talked about how symetric encryption works. This is by having a shared key that both parties use to simultaniously encrypt, and decrypt the data. (See Ceasar Cipher for example).

+ +

Public-key, or Asymetric Encryption

+ +

Asymetric encryption is based on the idea of having multiple keys instead of only one shared key. +For example: instead of encrypting with one key, and decrypting with that same key (like our ROT ciphers we talked about previously), we can use one key to encrypt the information, and a different key to decrypt the information.

+ +
+ Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key. +
+ Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key. +
+
+ +

In the picture above, see how Alice uses Bob’s public key to encrypt some data, +then sends it to Bob for him to decrypt with his private key? +That is the essense of public-key encryption.

+ +

The great thing about public-key encryption is that your public key is public! There is no need to be afraid of sending this everywhere! +You can attach it at the end of all your emails, the end of your forum posts, a link to it on your low-power webserver (wink). +There are even things called keyservers that will save your public key on them for retrival in case somebody wants to verify your public key.

+ +

Anything encrypted with your public key can only be decrypted with your private key. +Provided you never, NEVER share your private key with anyone ever, we can assume that all messages sent to you encrypted with your public key will never be read by anyone else.

+ +

Asymetric encryption, however, often contains four keys instead of two. Why is this?

+ +

Verification of Author

+ +

One interesting thing about keys pairs is that not only can the private key decrypt anything the public key encrypts, +but the public key can decrypt anything the private key encrypts.

+ +

Now why would one want to encrypt a message that can be decrypted by anyone?

+ +
+ Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it! +
+ Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it! +
+
+ Note: Although the picture shows otherwise, the text is not sent in the plain. It is encrypted with Alice's private key. +
+
+ +

This is how you can verify that the person who says they wrote the message really did indeed write the message! +If their private key was never shared with anyone else, then the message must have come from them!

+ +

For maximum security, these methods are often layered. +First, signing with the sender’s private key, +ensuring only they could have sent it— +then encrypted with the recipient’s pulbic key, +making sure only the reciever can read it.

+ +

Note that both sides must first have eachother’s public keys to do this. +This is easy if they communicate often, but when first contacting somebody, +people will generally send their encrypted message along with the their own pulbic key attached in a seperate file.

+ +

What This Means

+ +

Notice neither Alice nor Bob had to share any comprimsing information over the network? +This is why public-key encryption is so powerful!

+ +

Alice and Bob can both safely send their public keys in the open. +They can even send them over the insecure HTTP, or FTP protocols.

+ +

Whilst not sending any encryption-breaking messages, +Alice and Bob now have a way to communicate securely. +If you trust nothing and no one, this is your perfered method of security.

+ +

Check out this Computerphile video if you want the simplified explaination.

+ +

The Algorithms

+ +

The two biggest “implementations” of public-key cryptography vary only in the mathamatical equations used to generate the numbers, +and how the numbers are “trapdoored” to decrypt if you have the correct key.

+ +

I will discuss the differences in approach here. +If you want to skip to the next article where I show you how to encrypt your own documents using RSA, see this link.

+ +

RSA

+ +

The mathamatic center of the RSA system was developed over the course of a year or so. +Three men were involved. Ron Rivest, Adi Shamir, and Leonard Aldeman. +They worked as a kind of “team”: Each idea by Rivest and Shamir were critisized by the mathamatician on their team: Mr. Aldeman.

+ +

One night, after consuming +“liberal quantities of Manischewitz wine” +Rivest had trouble sleeping. +After taking long gazes into the abyss of his math textbook, he came up with an idea which would change cryptography forever. +By the next morning, an academic mathamatical paper was nearly finished. +He named it after himself and the two others that had been helping him along this whole time. Rivest, Shamir, Aldeman.

+ +

Key sizes of RSA range from 1024-bit to 4096-bit. +1024-bit keys are considered somewhat insecure. +However, +it should be noted that every bit doubles the complexity of the key, +so 2048 is 2^1024 times more complex than 1024.

+ +

Eliptic-Curve (EC)

+ +

Eliptic-Curve (EC) is a family of algorithms that use the Eliptic curve mathamatical structure to generate the numbers for the keys. +EC can effectivly provide the security of an RSA key one order of magnitude larger than an RSA key.

+ +
+ A picture of an eliptic curve. +
+ An eliptic curve structure. +
+
+ +

It’s fast; it’s secure! Perfect right?

+ +

Of course not!

+ +

One problem is that due to the smaller key size, +it can more easily be broken by brute-force. +This is why EC is mostly used for temporary communication (like HTTPS), not permenant communication (like having an encrypted email conversation with a journalist).

+ +

The other problem is that a certain EC algrorithm called P-256 is suspected to be introduced with malice to National Institute of Standards and Technology (NIST) +by the NSA. +Supposedly, the NSA is able to crack anything encrypted with this algorithm. +I will let the experts argure about that.

+ +

Other well-known EC algorithms that are more-or-less trusted as secure do exist though. +The premeire one being Curve25519. +The reference implementation of this algrorithm is also public-domain, +so it is easy for devlopers to work into their own applications without worrying about copywrite.

+ +

Conslusion

+ +

In this article we went over some basic points:

+ +
    +
  1. Public-key encryption enables secure communication over insecure networks.
  2. +
  3. RSA is considered the standard for extra-seure communication.
  4. +
  5. EC is a newer, faster, more transient encryption method.
  6. +
+ +

To learn how to use RSA keys to encrypt your own communications, check out this other aritcle I wrote.

+ + +
+ + + + +
+ + diff --git a/_site/2020/04/06/rsa4.html b/_site/2020/04/06/rsa4.html new file mode 100644 index 0000000..bfff5d9 --- /dev/null +++ b/_site/2020/04/06/rsa4.html @@ -0,0 +1,381 @@ + + + + + How To Encrypt Your Own Documents Using gpg + + + + +
+ + +

How To Encrypt Your Own Documents Using gpg

+

Monday, April 06 2020

+ +
+

If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds.

+ +

If you have never used Linux however, then the method of doing this will be rather unfamiliar. +This tutorial will be done on an Arch Linux machine, +but it should be the same on Ubuntu, Fedora, CentOS, Debian, +OpenBSD, FreeBSD, MacOSX, etc. +The only operating system that does not include these tools by default (or easily accessible) is Windows.

+ +

This tutorial makes heavy use of the terminal. +You have been warned.

+ +

Let us…begin!

+ +

Glossary

+ + + +

Step 0: Setup

+ +

We will be using the utility gpg for this tutorial.

+ +

The other thing to note: The character ‘$’ (dollar sign) is usually not typed when shown in a command. +It simply indicates that you do not need administrative privilages to run these commands.

+ +

Test to see if you get this output in your terminal.

+ +
+$ gpg --version
+
+gpg (GnuPG) 2.2.20
+libgcrypt 1.8.5
+Copyright (C) 2020 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
+
+...
+
+ +

If this is not successful look into how to install these tools on your system.

+ +

Step 1: Get/Create A Public Key!

+ +

Get Somebody Else’s

+

Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower.

+ +

To encrypt a document with somebody’s public key, you need to first obtain it. +My public key is available at this link, and you can use it to send me encrypted stuff.

+ +

If you are on a linux terminal, you can use the curl or wget command to download it.

+ +

wget:

+
+$ wget https://tait.tech/public-key.asc
+
+ +

Curl:

+
+$ curl https://tait.tech/public-key.asc -o public-key.asc
+
+ +

Make Your Own (optional)

+ +

The following section is quite long, +so if you don’t want to create your own keypair, +then feel free to skip to Step #2.

+ +

If you want to encrypt your own documents, +or you want others to be able to send you encrypted messages, +then you can create your own public/private key pair. +You can use these to encrypt your documents, +and you can send our public key to others so that they can securely communicate with yourself.

+ +

Run the following command in your terminal, and follow the steps I outline to get you started.

+ +
+$ gpg --full-gen-key
+
+ +

This will produce the following dialog:

+ +
+gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+
+Please select what kind of key you want:
+  (1) RSA and RSA (default)
+  (2) DSA and Elgamal
+  (3) DSA (sign only)
+  (4) RSA (sign only)
+  (14) Existing key from card
+Your selection? 
+
+ +

Select the option 1. You want two keys, both RSA.

+ +

Next we will select the key size:

+
+RSA keys may be between 1024 and 4096 bits long.
+What keysize do you want? (2048) 
+
+ +

Type the number 2048.

+ +

Next it will ask you how long you want the key to be valid.

+ +
+Requested keysize is 2048 bits
+Please specify how long the key should be valid.
+          0 = key does not expire
+       <n>  = key expires in n days
+       <n>w = key expires in n weeks
+       <n>m = key expires in n months
+       <n>y = key expires in n years
+Key is valid for? (0)
+
+ +

Type the number 1. This will enable you time to test it, +but it will make the key expire within 24 hours so that if you accidentally +share your private key, or delete your VM and no longer have access to it, you will be fine.

+ +

It will ask your if you are sure about the expiry date.

+ +
+Key expires at Tue Apr  7 02:24:23 2020 UTC
+Is this correct? (y/N) 
+
+ +

Type y to confirm your choice.

+ +

Now gpg is going to ask you to create a user id to indetify this key. +Use some test data for now. +User input is in bold, feel free to follow along or to put your own test data in.

+ +

Once you are more comfortable with the tools, +then you can create a public/private keypair that you will keep for some time.

+ +
+GnuPG needs to construct a user ID to identify your key.
+
+Real name: Mr. Tester
+Email address: test@test.org
+Comment: for testing only
+You selected this USER-ID:
+    "Mr. Tester (for testing only) <test@test.org>"
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
+
+ +

It will then ask you for a password. +If you are simply using this for test purposes, +then you can feel free to set it to something like “test”. +When create a long-term use pulbic key make sure to make the password very secure.

+ +

During the process of creating your key, gpg may warn you with this message:

+ +
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+ +

If this happens, feel free to smash your keyboard (lightly), +watch a YouTube video on the machine, +browse the web with w3m, +etc. until the key is generated.

+ +

You will know it is done when you see this message (or something similar):

+ +
+gpg: key EACCC490291EA7CE marked as ultimately trusted
+gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev'
+public and secret key created and signed.
+
+pub   rsa2048 2020-04-06 [SC] [expires: 2020-04-07]
+      FFA7D7525C6546983F1152D8EACCC490291EA7CE
+      uid                      Mr. Tester (for testing only) <test@test.org>
+      sub   rsa2048 2020-04-06 [E] [expires: 2020-04-07]
+
+ +

Tada! You have your own public/private keypair!

+ +

Sharing a keypair that will expire soon is not a good idea, +however, if you are ready, then you can use this command to generate a public key file to share with others.

+ +

Feel free to substitute “Mr. Tester” for any other identifying part of your key. +Remember that to use the email, you must enclose it in < and >.

+ +
+$ gpg --export --armour "Mr. Tester" > public-key.asc
+
+ +

To use the email as the identifier:

+
+$ gpg --export --armour "<test@test.org>" > public-key.asc
+
+ +

Step 2: Import Public Key

+ +

This list of keys that gpg keeps on tap so to speak, is called our “keyring”. +Your will need to import a new public key to encrypt files with gpg.

+ +

If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :)

+ +
+ A keyring holding eight allen keys. +
+ A keyring holding eight allen keys. +
+
+ +

To import a public key to use for encrypting files, use the --import option of gpg. Like so:

+ +
+$ gpg --import public-key.asc
+gpg: key 64FB4E386953BEAD: public key "Tait Hoyem <tait.hoyem@protonmail.com>" imported
+gpg: Total number processed: 1
+gpg:               imported: 1
+
+ +

Now that we have imported a public key, we can make a message to send!

+ +

Step 3: Have A Message To Encrypt

+ +

You can make a new file which holds some important, secret data. +Feel free to use a graphical editor if you have one, if not, nano works alright too.

+ +
+  Rules Of A Good Life:
+
+  1. Wash your hands!
+  2. Work hard!
+  3. Be firm.
+  5. Have good friends!
+
+ +

Save this file as something like test-pgp.txt, and we’ll use that name later.

+ +

Step 4: Encrypt A Message

+ +

Now that we have a message to send and person to send to, +all we have to do is encrypt this message and it’ll be on its merry way! +To do so, we must specify two new options to gpg.

+ +

The first is --recipient. +This tells gpg to encrypt using a certin public key that we have in our keyring. +You can use the person’s name, email address, or the key’s uid.

+ +

The second is --encrypt.

+ +

You will also specify the --armour option to use ASCII armoured files. Put this option after --encrypt, and put the file name after --armour. See below.

+ +

You can either use your own public key name to encrypt a document (allowng only you to decrypt it), +or you can use my public key that we imported earlier (allowing only me to decrypt it). +Either way works fine.

+ +

This is the big one!

+ +
+$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt
+
+ +

“But there is no output!” you might say! +Yes, that is because our new (encrypted) file has already been saved. +Let’s look at it with cat.

+ +
+$ cat test-gpg.txt.asc
+-----BEGIN PGP MESSAGE-----
+
+hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP
+XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu
+0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm
+Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi
+MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G
+079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b
+p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe
+Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj
+0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo
+cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/
+9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS
+mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm
+bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu
+jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF
+nv117moLfK22Mst/
+=bw8T
+-----END PGP MESSAGE-----
+
+ +

Step 5: Decryption (optional)

+ +

If you created your own public/private keypair in step 1, +and you encryped using --recipient "Your Test Name", +then you can decrypt your document as well!

+ +

You will need to specify --decrypt, and that’s all folks!

+ +
+$ gpg --decrypt test-gpg.txt.asc
+
+ +

A password dialog will then come up asking for your previously created password. +As long as you remember your password from before and enter it correctly: voila!

+ +
+gpg: encrypted with 4096-bit RSA key, ID 6989B986FCBE4225, created 2020-01-02
+      "Tait Hoyem <tait.hoyem@protonmail.com>"
+Rules Of A Good Life:
+
+1. Wash your hands!
+2. Work hard!
+3. Be firm.
+5. Have good friends!
+
+ +

Step 6: Finale!

+ +

Ladies and gentleman, you have done it! +You have encrypted our very own document. +(And maybe even decrypted it yourself too :)

+ +

If you encrypted using my public key, +feel free to send it to my email. +I am happy to verify if it worked.

+ +

For more information on this subject, check out gnugp.org’s guide on using GPG. +They are the ones that make these tools available, +and the GNU Project has been instrumental in creating the open-source world as it exists today. +Give ‘em some love, eh!

+ +

Thank you so much for sticking through this whole thing! +Let me know if there is anything that doesn’t make sense. +I am happy to improve this guide as time goes on if that is necessary.

+ +

Happy hacking :)

+ +
+ + + + +
+ + diff --git a/_site/README.md b/_site/README.md index 63909df..111c6c2 100644 --- a/_site/README.md +++ b/_site/README.md @@ -1,2 +1,23 @@ # tait.tech The uncompiled version of my website. Compiled files in _site + +### To compile + +To compile the files, simply use the bundle Ruby gem. + +``` +bundle exec jekyll build +``` + +to compile once. If you decide you want to actually have changes appear instantly, use the following + +``` +bundle exec jekyll watch +``` + +To run a local web server to view the changes on: +``` +bundle exec jekyll server -w +``` + +This will watch for the latest changes, compile them, and make them available on localhost:4000 diff --git a/_site/assets/css/style.css b/_site/assets/css/style.css index b948edb..8d7d1d5 100644 --- a/_site/assets/css/style.css +++ b/_site/assets/css/style.css @@ -79,4 +79,10 @@ sup { margin: 0; padding: 0; } figcaption { font-size: .8em; text-decoration: italic; } +footer { border-top: 1px solid #aaa; margin-bottom: 100px; } + +.terminal { line-height: 1em; overflow: scroll; padding: 10px; color: #00FF41; margin: 0px; background-color: #151515; } + +.small-image { width: 100%; } + /*# sourceMappingURL=style.css.map */ \ No newline at end of file diff --git a/_site/assets/css/style.css.map b/_site/assets/css/style.css.map index 3a04af5..27647c7 100644 --- a/_site/assets/css/style.css.map +++ b/_site/assets/css/style.css.map @@ -7,8 +7,8 @@ ], "sourcesContent": [ "@import \"main\";\n", - "$normal-text-color: #444444;\n$nav-link-color: #333;\n$nav-link-hover-color: black;\n$link-color: #47a;\n$visited-link-color: #941452;\n\n$last-p-padd: 1.5em;\n$nav-padd: 1em;\n$line-under: 1px solid #aaa; \n\nbody {\n background-color: #fefefe;\n padding: 15px;\n margin: auto;\n max-width: 600px;\n font-family: -apple-system, helvetica, arial, sans-serif;\n}\n#wrapper {\n color: $normal-text-color;\n font-size: 14px;\n}\n#main-name {\n color: rgba(0, 0, 0, 0.8);\n}\nh1, h2, h3, h4, h5, h6 {\n}\nh1 {\n font-size: 2.5em;\n}\nh2 {\n font-size: 1.3em;\n}\nh4 {\n}\na {\n text-decoration: underline;\n color: $link-color;\n} \na:visited {\n color: $visited-link-color;\n}\na.nav-link,\na.post-title-link {\n color: $nav-link-color;\n text-decoration: none;\n}\na.citation-link {\n text-decoration: none;\n}\n\nlabel {\n font-size: .8em;\n}\n\n#menu,\nlabel[for=\"menu\"]{\n display: none;\n}\n\nnav {\n padding: $nav-padd 0px;\n margin: 0px;\n}\nnav a:first-of-type {\n margin-left: 0;\n}\nnav a {\n margin: 1em;\n color: $nav-link-color;\n font-weight: bold;\n font-style: none;\n}\nnav a.on-page {\n color: #888;\n}\nnav a:hover {\n text-decoration: underline; \n}\n\nli {\n margin: .5em;\n}\n\n#main-img {\n width: 100%;\n}\np {\n line-height: 1.5;\n padding: .1em 0;\n}\n.line-under {\n padding-bottom: $last-p-padd;\n border-bottom: $line-under;\n}\n.article a:hover {\n color: rgba(0, 0, 0, 0.5);\n}\n.post-date {\n text-transform: uppercase;\n font-weight: bold;\n color: rgba(0, 0, 0, 0.5);\n}\n\n.post-desc {\n color: rgba(0, 0, 0, .7);\n padding: 10px;\n font-weight: lighter;\n}\n\np.post-excerpt {\n margin-top: 0;\n padding-top: 10px;\n}\n\n\ntable,\ntable tr,\ntable td,\ntable th{\n border: 1px solid rgba(0, 0, 0, 0.5);\n border-collapse: collapse;\n padding: 5px;\n font-weight: normal;\n}\ntable th {\n font-weight: bold;\n}\ntable {\n width: 75%;\n margin: auto;\n}\n\ntable.post-list,\ntable.post-list tr,\ntable.post-list td {\n width: 100%;\n border: none;\n padding-left: 0;\n}\nimg {\n display: block;\n width: 55%;\n margin-left: auto;\n margin-right: auto;\n}\n\nblockquote {\n font-style: italic;\n}\n\n@media screen and (max-width: 600px){\n #menu,\n label[for=\"menu\"]{\n display: inline-block;\n font-size: 20px;\n }\n body {\n width: 90%;\n }\n #info {\n margin: 0 7px;\n }\n .menu-content {\n max-height: 0;\n overflow: hidden;\n }\n nav {\n width: 100%;\n }\n nav a {\n display: block;\n padding-left: 0;\n margin-left: 0;\n }\n input#menu{\n display: none;\n }\n input:checked ~ .menu-content {\n max-height: 100%;\n border-bottom: $line-under;\n color: red;\n }\n}\n\n.contact-info {\n width: 90%;\n margin: auto;\n word-wrap: break-word;\n}\n.contact-info p {\n margin: 7px;\n padding: 0;\n}\n\n.mono {\n font-family: monospace;\n}\n\n.bold {\n font-weight: bold;\n}\n\nsup {\n margin: 0;\n padding: 0;\n}\n\nfigcaption {\n font-size: .8em;\n text-decoration: italic;\n}\n" + "$normal-text-color: #444444;\n$nav-link-color: #333;\n$nav-link-hover-color: black;\n$link-color: #47a;\n$visited-link-color: #941452;\n\n$last-p-padd: 1.5em;\n$nav-padd: 1em;\n$line-under: 1px solid #aaa; \n\nbody {\n background-color: #fefefe;\n padding: 15px;\n margin: auto;\n max-width: 600px;\n font-family: -apple-system, helvetica, arial, sans-serif;\n}\n#wrapper {\n color: $normal-text-color;\n font-size: 14px;\n}\n#main-name {\n color: rgba(0, 0, 0, 0.8);\n}\nh1, h2, h3, h4, h5, h6 {\n}\nh1 {\n font-size: 2.5em;\n}\nh2 {\n font-size: 1.3em;\n}\nh4 {\n}\na {\n text-decoration: underline;\n color: $link-color;\n} \na:visited {\n color: $visited-link-color;\n}\na.nav-link,\na.post-title-link {\n color: $nav-link-color;\n text-decoration: none;\n}\na.citation-link {\n text-decoration: none;\n}\n\nlabel {\n font-size: .8em;\n}\n\n#menu,\nlabel[for=\"menu\"]{\n display: none;\n}\n\nnav {\n padding: $nav-padd 0px;\n margin: 0px;\n}\nnav a:first-of-type {\n margin-left: 0;\n}\nnav a {\n margin: 1em;\n color: $nav-link-color;\n font-weight: bold;\n font-style: none;\n}\nnav a.on-page {\n color: #888;\n}\nnav a:hover {\n text-decoration: underline; \n}\n\nli {\n margin: .5em;\n}\n\n#main-img {\n width: 100%;\n}\np {\n line-height: 1.5;\n padding: .1em 0;\n}\n.line-under {\n padding-bottom: $last-p-padd;\n border-bottom: $line-under;\n}\n.article a:hover {\n color: rgba(0, 0, 0, 0.5);\n}\n.post-date {\n text-transform: uppercase;\n font-weight: bold;\n color: rgba(0, 0, 0, 0.5);\n}\n\n.post-desc {\n color: rgba(0, 0, 0, .7);\n padding: 10px;\n font-weight: lighter;\n}\n\np.post-excerpt {\n margin-top: 0;\n padding-top: 10px;\n}\n\n\ntable,\ntable tr,\ntable td,\ntable th{\n border: 1px solid rgba(0, 0, 0, 0.5);\n border-collapse: collapse;\n padding: 5px;\n font-weight: normal;\n}\ntable th {\n font-weight: bold;\n}\ntable {\n width: 75%;\n margin: auto;\n}\n\ntable.post-list,\ntable.post-list tr,\ntable.post-list td {\n width: 100%;\n border: none;\n padding-left: 0;\n}\nimg {\n display: block;\n width: 55%;\n margin-left: auto;\n margin-right: auto;\n}\n\nblockquote {\n font-style: italic;\n}\n\n@media screen and (max-width: 600px){\n #menu,\n label[for=\"menu\"]{\n display: inline-block;\n font-size: 20px;\n }\n body {\n width: 90%;\n }\n #info {\n margin: 0 7px;\n }\n .menu-content {\n max-height: 0;\n overflow: hidden;\n }\n nav {\n width: 100%;\n }\n nav a {\n display: block;\n padding-left: 0;\n margin-left: 0;\n }\n input#menu{\n display: none;\n }\n input:checked ~ .menu-content {\n max-height: 100%;\n border-bottom: $line-under;\n color: red;\n }\n}\n\n.contact-info {\n width: 90%;\n margin: auto;\n word-wrap: break-word;\n}\n.contact-info p {\n margin: 7px;\n padding: 0;\n}\n\n.mono {\n font-family: monospace;\n}\n\n.bold {\n font-weight: bold;\n}\n\nsup {\n margin: 0;\n padding: 0;\n}\n\nfigcaption {\n font-size: .8em;\n text-decoration: italic;\n}\n\nfooter {\n border-top: $line-under; \n margin-bottom: 100px;\n}\n\n.terminal {\n line-height: 1em;\n overflow: scroll;\n padding: 10px; \n color: #00FF41;\n margin: 0px;\n background-color: #151515;\n}\n\n.small-image {\n width: 100%;\n}\n" ], "names": [], - "mappings": "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" + "mappings": "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" } \ No newline at end of file diff --git a/_site/assets/img/alice-sign-to-bob.png b/_site/assets/img/alice-sign-to-bob.png new file mode 100644 index 0000000..cfce6bf Binary files /dev/null and b/_site/assets/img/alice-sign-to-bob.png differ diff --git a/_site/assets/img/alice-to-bob.png b/_site/assets/img/alice-to-bob.png new file mode 100644 index 0000000..eaf5e64 Binary files /dev/null and b/_site/assets/img/alice-to-bob.png differ diff --git a/_site/assets/img/ec.png b/_site/assets/img/ec.png new file mode 100644 index 0000000..c7532a2 Binary files /dev/null and b/_site/assets/img/ec.png differ diff --git a/_site/assets/img/keyring.jpg b/_site/assets/img/keyring.jpg new file mode 100644 index 0000000..279c46d Binary files /dev/null and b/_site/assets/img/keyring.jpg differ diff --git a/_site/assets/img/public-key-example1.svg b/_site/assets/img/public-key-example1.svg new file mode 100644 index 0000000..a9220e8 --- /dev/null +++ b/_site/assets/img/public-key-example1.svg @@ -0,0 +1,201 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 鮑伯 + 你好! + + + Hello + Bob! + + + + + + 鮑伯的 + 私有密鑰 + + + Bob's + Private Key + + + + + 加密 + Encrypt + + + 6EB6957008E03CE4 + + + + + 鮑伯 + 你好! + + + Hello + Bob! + + + + + 解密 + Decrypt + + + + + 鮑伯的 + 公開金鑰 + + + Bob's + Public Key + + + + 愛麗斯 + Alice + + + + 鮑伯 + Bob + + + + + + + + diff --git a/_site/assets/img/wget-log b/_site/assets/img/wget-log new file mode 100644 index 0000000..6e8c91c --- /dev/null +++ b/_site/assets/img/wget-log @@ -0,0 +1,12 @@ +--2020-04-02 20:52:24-- https://www.google.com/url?sa=i +Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' +Resolving www.google.com (www.google.com)... 172.217.3.196, 2607:f8b0:400a:809::2004 +Connecting to www.google.com (www.google.com)|172.217.3.196|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: unspecified [text/html] +Saving to: 'url?sa=i' + + url?sa=i [<=> ] 0 --.-KB/s url?sa=i [ <=> ] 1.38K --.-KB/s in 0s + +2020-04-02 20:52:24 (10.1 MB/s) - 'url?sa=i' saved [1414] + diff --git a/_site/blog/index.html b/_site/blog/index.html index a919e30..00191c9 100644 --- a/_site/blog/index.html +++ b/_site/blog/index.html @@ -26,6 +26,26 @@ + + + + + + + +
+

How To Encrypt Your Own Documents Using gpg

+ +

If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds.

+
+
+

How Asymetric Encryption Works

+ +

In a few previous articles I have explained why encryption may be important to you and how the theory behind encryption works. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.

+
+

How Does Encryption Work, in Theory?

diff --git a/_site/feed.xml b/_site/feed.xml index f835fb3..eb14a55 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,4 +1,484 @@ -Jekyll2020-03-10T22:25:54+00:00/feed.xmlHow Does Encryption Work, in Theory?2020-02-19T00:00:00+00:002020-02-19T00:00:00+00:00/2020/02/19/rsa2<p>There are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in <a href="/2020/01/26/rsa1.html">this article</a> why encryption is important, and why <em>you</em> should care about it.</p> +Jekyll2020-04-06T03:53:39+00:00http://localhost:4000/feed.xmlHow To Encrypt Your Own Documents Using gpg2020-04-06T00:00:00+00:002020-04-06T00:00:00+00:00http://localhost:4000/2020/04/06/rsa4<p>If you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! +It should be noted that in some circles the tools used are more common than in others. +These are the everyday tools of many privacy advocates and computer nerds.</p> + +<p>If you have never used Linux however, then the method of doing this will be rather unfamiliar. +This tutorial will be done on an <a href="https://archlinux.org/">Arch Linux</a> machine, +but it should be the same on Ubuntu, Fedora, CentOS, Debian, +OpenBSD, FreeBSD, MacOSX, etc. +The only operating system that does not include these tools by default (or easily accessible) is Windows.</p> + +<p>This tutorial makes heavy use of the terminal. +You have been warned.</p> + +<p><em>Let us…begin!</em></p> + +<h2 id="glossary">Glossary</h2> + +<ul> + <li><a href="https://en.wikipedia.org/wiki/Binary-to-text_encoding#ASCII_armor"><strong>ASCII armour</strong></a> — A way to encode <strong>OpenPGP</strong> documents so they are readable by humans. These files end in .asc</li> + <li><strong>(Open)PGP</strong> — An open standard for encoding pulbic keys and encrypted documents.</li> + <li><strong>GPG</strong> — GNUPrivacyGaurd is an implementation of <strong>OpenPGP</strong>. It is installed by default on most Linux distrobutions.</li> +</ul> + +<h2 id="step-0-setup">Step 0: Setup</h2> + +<p>We will be using the utility <code class="highlighter-rouge">gpg</code> for this tutorial.</p> + +<p>The other thing to note: The character ‘$’ (dollar sign) is usually not typed when shown in a command. +It simply indicates that you do not need administrative privilages to run these commands.</p> + +<p>Test to see if you get this output in your terminal.</p> + +<pre class="terminal"> +$ gpg --version + +gpg (GnuPG) 2.2.20 +libgcrypt 1.8.5 +Copyright (C) 2020 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later &lt;https://gnu.org/licenses/gpl.html&gt; + +... +</pre> + +<p>If this is not successful look into how to install these tools on your system.</p> + +<h2 id="step-1-getcreate-a-public-key">Step 1: Get/Create A Public Key!</h2> + +<h3 id="get-somebody-elses">Get Somebody Else’s</h3> +<p>Step one is having somebody to send your encrypted message to. Maybe this is a friend, a journalist, or a whistleblower.</p> + +<p>To encrypt a document with somebody’s public key, you need to first obtain it. +My public key is available <a href="/public-key.asc">at this link</a>, and you can use it to send me encrypted stuff.</p> + +<p>If you are on a linux terminal, you can use the <code class="highlighter-rouge">curl</code> or <code class="highlighter-rouge">wget</code> command to download it.</p> + +<p>wget:</p> +<pre class="terminal"> +$ wget https://tait.tech/public-key.asc +</pre> + +<p>Curl:</p> +<pre class="terminal"> +$ curl https://tait.tech/public-key.asc -o public-key.asc +</pre> + +<h3 id="make-your-own-optional">Make Your Own (optional)</h3> + +<p>The following section is quite long, +so if you don’t want to create your own keypair, +then feel free to skip to <a href="#step-2-import-public-key">Step #2</a>.</p> + +<p>If you want to encrypt your own documents, +or you want others to be able to send you encrypted messages, +then you can create your own public/private key pair. +You can use these to encrypt your documents, +and you can send our public key to others so that they can securely communicate with yourself.</p> + +<p>Run the following command in your terminal, and follow the steps I outline to get you started.</p> + +<pre class="terminal"> +$ gpg --full-gen-key +</pre> + +<p>This will produce the following dialog:</p> + +<pre class="terminal"> +gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Please select what kind of key you want: + (1) RSA and RSA (default) + (2) DSA and Elgamal + (3) DSA (sign only) + (4) RSA (sign only) + (14) Existing key from card +Your selection? +</pre> + +<p>Select the option <code class="highlighter-rouge">1</code>. You want two keys, both RSA.</p> + +<p>Next we will select the key size:</p> +<pre class="terminal"> +RSA keys may be between 1024 and 4096 bits long. +What keysize do you want? (2048) +</pre> + +<p>Type the number 2048.</p> + +<p>Next it will ask you how long you want the key to be valid.</p> + +<pre class="terminal"> +Requested keysize is 2048 bits +Please specify how long the key should be valid. + 0 = key does not expire + &lt;n&gt; = key expires in n days + &lt;n&gt;w = key expires in n weeks + &lt;n&gt;m = key expires in n months + &lt;n&gt;y = key expires in n years +Key is valid for? (0) +</pre> + +<p>Type the number 1. This will enable you time to test it, +but it will make the key expire within 24 hours so that if you accidentally +share your private key, or delete your VM and no longer have access to it, you will be fine.</p> + +<p>It will ask your if you are sure about the expiry date.</p> + +<pre class="terminal"> +Key expires at Tue Apr 7 02:24:23 2020 UTC +Is this correct? (y/N) +</pre> + +<p>Type <code class="highlighter-rouge">y</code> to confirm your choice.</p> + +<p>Now <code class="highlighter-rouge">gpg</code> is going to ask you to create a user id to indetify this key. +Use some test data for now. +User input is in bold, feel free to follow along or to put your own test data in.</p> + +<p>Once you are more comfortable with the tools, +then you can create a public/private keypair that you will keep for some time.</p> + +<pre class="terminal"> +GnuPG needs to construct a user ID to identify your key. + +Real name: <b>Mr. Tester</b> +Email address: <b>test@test.org</b> +Comment: <b>for testing only</b> +You selected this USER-ID: + "Mr. Tester (for testing only) &lt;test@test.org&gt;" + +Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? <b>O</b> +</pre> + +<p>It will then ask you for a password. +If you are simply using this for test purposes, +then you can feel free to set it to something like “test”. +When create a long-term use pulbic key make sure to make the password <em>very</em> secure.</p> + +<p>During the process of creating your key, <code class="highlighter-rouge">gpg</code> may warn you with this message:</p> + +<pre class="terminal"> +We need to generate a lot of random bytes. It is a good idea to perform +some other action (type on the keyboard, move the mouse, utilize the +disks) during the prime generation; this gives the random number +generator a better chance to gain enough entropy. +</pre> + +<p>If this happens, feel free to smash your keyboard (lightly), +watch a YouTube video on the machine, +browse the web with <a href="http://w3m.sourceforge.net/">w3m</a>, +etc. until the key is generated.</p> + +<p>You will know it is done when you see this message (or something similar):</p> + +<pre class="terminal"> +gpg: key EACCC490291EA7CE marked as ultimately trusted +gpg: revocation certificate stored as '/home/tait/.config/gnupg/openpgp-revocs.d/FFA7D7525C6546983F1152D8EACCC490291EA7CE.rev' +public and secret key created and signed. + +pub rsa2048 2020-04-06 [SC] [expires: 2020-04-07] + FFA7D7525C6546983F1152D8EACCC490291EA7CE + uid Mr. Tester (for testing only) &lt;test@test.org&gt; + sub rsa2048 2020-04-06 [E] [expires: 2020-04-07] +</pre> + +<p>Tada! You have your own public/private keypair!</p> + +<p>Sharing a keypair that will expire soon is not a good idea, +however, if you are ready, then you can use this command to generate a public key file to share with others.</p> + +<p>Feel free to substitute “Mr. Tester” for any other identifying part of your key. +Remember that to use the email, you must enclose it in &lt; and &gt;.</p> + +<pre class="terminal"> +$ gpg --export --armour "Mr. Tester" &gt; public-key.asc +</pre> + +<p>To use the email as the identifier:</p> +<pre class="terminal"> +$ gpg --export --armour "&lt;test@test.org&gt;" &gt; public-key.asc +</pre> + +<h2 id="step-2-import-public-key">Step 2: Import Public Key</h2> + +<p>This list of keys that <code class="highlighter-rouge">gpg</code> keeps on tap so to speak, is called our “keyring”. +Your will need to import a new public key to encrypt files with <code class="highlighter-rouge">gpg</code>.</p> + +<p>If you already created your own public key, then this step is not necessary unless you want to also encrypt something for me :)</p> + +<figure> + <img src="/assets/img/keyring.jpg" alt="A keyring holding eight allen keys." /> + <figcaption> + A keyring holding eight allen keys. + </figcaption> +</figure> + +<p>To import a public key to use for encrypting files, use the <code class="highlighter-rouge">--import</code> option of <code class="highlighter-rouge">gpg</code>. Like so:</p> + +<pre class="terminal"> +$ gpg --import public-key.asc +gpg: key 64FB4E386953BEAD: public key "Tait Hoyem &lt;tait.hoyem@protonmail.com&gt;" imported +gpg: Total number processed: 1 +gpg: imported: 1 +</pre> + +<p>Now that we have imported a public key, we can make a message to send!</p> + +<h2 id="step-3-have-a-message-to-encrypt">Step 3: Have A Message To Encrypt</h2> + +<p>You can make a new file which holds some important, secret data. +Feel free to use a graphical editor if you have one, if not, <code class="highlighter-rouge">nano</code> works alright too.</p> + +<pre class="terminal"> + Rules Of A Good Life: + + 1. Wash your hands! + 2. Work hard! + 3. Be firm. + 5. Have good friends! +</pre> + +<p>Save this file as something like <code class="highlighter-rouge">test-pgp.txt</code>, and we’ll use that name later.</p> + +<h2 id="step-4-encrypt-a-message">Step 4: Encrypt A Message</h2> + +<p>Now that we have a message to send and person to send to, +all we have to do is encrypt this message and it’ll be on its merry way! +To do so, we must specify two new options to <code class="highlighter-rouge">gpg</code>.</p> + +<p>The first is <code class="highlighter-rouge">--recipient</code>. +This tells <code class="highlighter-rouge">gpg</code> to encrypt using a certin public key that we have in our keyring. +You can use the person’s name, email address, or the key’s uid.</p> + +<p>The second is <code class="highlighter-rouge">--encrypt</code>.</p> + +<p>You will also specify the <code class="highlighter-rouge">--armour</code> option to use ASCII armoured files. Put this option after <code class="highlighter-rouge">--encrypt</code>, and put the file name after <code class="highlighter-rouge">--armour</code>. See below.</p> + +<p>You can either use your own public key name to encrypt a document (allowng only you to decrypt it), +or you can use my public key that we imported earlier (allowing only me to decrypt it). +Either way works fine.</p> + +<p>This is the big one!</p> + +<pre class="terminal"> +$ gpg --recipient "Tait Hoyem" --encrypt --armour test-gpg.txt +</pre> + +<p>“But there is no output!” you might say! +Yes, that is because our new (encrypted) file has already been saved. +Let’s look at it with cat.</p> + +<pre class="terminal"> +$ cat test-gpg.txt.asc +-----BEGIN PGP MESSAGE----- + +hQIMA2mJuYb8vkIlAQ/9FDmXJgW2vI7p9sznKvHhQk7uTZvoWC3hCeqHoO3BSElP +XR1BNAkJ+bykB30M+9u+XDyRtTwazjvNPmYfQnIh0Q+BQZigDWbEd1R47jbzm7Tu +0eZKKapgEidfecULtaECX1sR3qPt1m9oZjyUR1rzNd8tezZlCu2pjdNZrkta2Bdm +Hh1xDS43Bw7PMQqraJsHwqr0M1GLDbMzPes2ZU5y4jEmXZ0PZdJ7kgjR8dvhLBfi +MU+4kYnnemQEztXBOjKidhyOntKiLjenvD00tVHrOuQoWuWCHGiqR24qSwVjeb9G +079gqH1VWi3fk2cwFA9f3TLvJqUwatyE0Hcba0U1d2Voz/C9JEQjT6FHuaCqQL6b +p7B7m2DwpywFGJpAn6ksrEYqHaLVWiEGmdMmHYuHxMw8+cqoSwbYymCZTwMBAuJe +Pr1VO9uNo+Vj5r8IX7ACcSsrjf0XkVzfX6ySsPbyOlGXnwzWSOM3Dk2Z9MqDORbj +0/7vJTnDctPuc91Rlp3YnJlZKWMcNfPMKMtvpljd2XuVwub+C4vGWXa9XLbRXmJo +cnEFT6SB11AKjytE2Urt62CCrYjJPBneabxbCztnBs+vQSx7Fj0LK6v4Euik/Xm/ +9aKmZZW8306c9Zwgpp9glWjLMCDNxJRGdKRjZsnkt9hOEYsP1irTegystK6u4eHS +mwHX931ENOJsnPfQZCZ9b41Q9doZQ/N/WHstQO8MtA3HIN1sW3wYkGzOLKj4gJfm +bqR/TzQmXyLT1xZa+/yTscaV0P4OlI4vcii/k4DgeSeQVWp9o9DbZFxSCsdYVvPu +jaDMzZnIKoax1GFz/coUAHFQub2rLzaQ5DDbvrkX++UrAjuUtRcSFH0TKhahZmCF +nv117moLfK22Mst/ +=bw8T +-----END PGP MESSAGE----- +</pre> + +<h2 id="step-5-decryption-optional">Step 5: Decryption (optional)</h2> + +<p>If you created your own public/private keypair in step 1, +and you encryped using <code class="highlighter-rouge">--recipient "Your Test Name"</code>, +then you can decrypt your document as well!</p> + +<p>You will need to specify <code class="highlighter-rouge">--decrypt</code>, and that’s all folks!</p> + +<pre class="terminal"> +$ gpg --decrypt test-gpg.txt.asc +</pre> + +<p>A password dialog will then come up asking for your previously created password. +As long as you remember your password from before and enter it correctly: voila!</p> + +<pre class="terminal"> +gpg: encrypted with 4096-bit RSA key, ID 6989B986FCBE4225, created 2020-01-02 + "Tait Hoyem &lt;tait.hoyem@protonmail.com&gt;" +Rules Of A Good Life: + +1. Wash your hands! +2. Work hard! +3. Be firm. +5. Have good friends! +</pre> + +<h2 id="step-6-finale">Step 6: Finale!</h2> + +<p>Ladies and gentleman, you have done it! +You have encrypted our very own document. +(And maybe even decrypted it yourself too :)</p> + +<p>If you encrypted using my public key, +feel free to send it to <a href="mailto:tait@tait.tech">my email</a>. +I am happy to verify if it worked.</p> + +<p>For more information on this subject, check out <a href="https://www.gnupg.org/gph/en/manual/c14.html">gnugp.org’s guide</a> on using GPG. +They are the ones that make these tools available, +and the <a href="https://www.gnu.org/">GNU Project</a> has been instrumental in creating the open-source world as it exists today. +Give ‘em some love, eh!</p> + +<p>Thank you so much for sticking through this whole thing! +Let me know if there is anything that doesn’t make sense. +I am happy to improve this guide as time goes on if that is necessary.</p> + +<p>Happy hacking :)</p>taitIf you have ever wanted to garuntee the utmost security of your emails and documents, then this is the guide for you! It should be noted that in some circles the tools used are more common than in others. These are the everyday tools of many privacy advocates and computer nerds.How Asymetric Encryption Works2020-04-02T00:00:00+00:002020-04-02T00:00:00+00:00http://localhost:4000/2020/04/02/rsa3<p>In a few previous articles I have explained <a href="/2020/01/26/rsa1.html">why encryption may be important to you</a> and <a href="/2020/02/19/rsa2.html">how the theory behind encryption works</a>. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.</p> + +<p>Previously, we talked about how <em>symetric</em> encryption works. This is by having a shared key that both parties use to simultaniously encrypt, and decrypt the data. (See Ceasar Cipher for example).</p> + +<h2 id="public-key-or-asymetric-encryption">Public-key, or Asymetric Encryption</h2> + +<p>Asymetric encryption is based on the idea of having multiple keys instead of only one shared key. +For example: instead of encrypting with one key, and decrypting with that same key (like our ROT ciphers we talked about previously), we can use one key to <em>encrypt</em> the information, and a different key to <em>decrypt</em> the information.</p> + +<figure> + <img src="/assets/img/alice-to-bob.png" alt="Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key." /> + <figcaption> + Alice sending her message to Bob using Bob's public key. Bob decrypts the message with his private key. + </figcaption> +</figure> + +<p>In the picture above, see how Alice uses Bob’s public key to encrypt some data, +then sends it to Bob for him to decrypt with his private key? +That is the essense of public-key encryption.</p> + +<p>The great thing about public-key encryption is that your public key is <em>public</em>! There is no need to be afraid of sending this everywhere! +You can attach it at the end of all your emails, the end of your forum posts, <a href="/public-key.asc">a link to it on your low-power webserver</a> (wink). +There are even things called <a href="http://keys.gnupg.net/">keyservers</a> that will save your public key on them for retrival in case somebody wants to verify your public key.</p> + +<p>Anything encrypted with your public key can only be decrypted with your private key. +Provided you never, <em>NEVER</em> share your private key with anyone ever, we can assume that all messages sent to you encrypted with your public key will never be read by anyone else.</p> + +<p>Asymetric encryption, however, often contains four keys instead of two. Why is this?</p> + +<h4 id="verification-of-author">Verification of Author</h4> + +<p>One interesting thing about keys pairs is that not only can the private key decrypt anything the public key encrypts, +but the public key can decrypt anything the private key encrypts.</p> + +<p>Now why would one want to encrypt a message that can be decrypted by anyone?</p> + +<figure> + <img src="/assets/img/alice-sign-to-bob.png" alt="Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it!" /> + <figcaption> + Alice sending a message to bob which is 'signed' with her private key. This allows Bob to know only Alice could have sent it! + <br /> + <br /> + Note: Although the picture shows otherwise, the text is not sent in the plain. It is encrypted with Alice's private key. + </figcaption> +</figure> + +<p>This is how you can verify that the person who says they wrote the message really did indeed write the message! +If their private key was never shared with anyone else, then the message must have come from them!</p> + +<p>For maximum security, these methods are often layered. +First, signing with the sender’s private key, +ensuring only they could have sent it— +then encrypted with the recipient’s pulbic key, +making sure only the reciever can read it.</p> + +<p>Note that both sides must first have eachother’s public keys to do this. +This is easy if they communicate often, but when first contacting somebody, +people will generally send their encrypted message along with the their own pulbic key attached in a seperate file.</p> + +<h3 id="what-this-means">What This Means</h3> + +<p>Notice neither Alice nor Bob had to share any comprimsing information over the network? +This is why public-key encryption is so powerful!</p> + +<p>Alice and Bob can both safely send their public keys in the open. +They can even send them over the insecure HTTP, or FTP protocols.</p> + +<p>Whilst not sending any encryption-breaking messages, +Alice and Bob now have a way to communicate securely. +If you trust nothing and no one, this is your perfered method of security.</p> + +<p>Check out this <a href="https://www.youtube.com/watch?v=GSIDS_lvRv4">Computerphile video</a> if you want the simplified explaination.</p> + +<h3 id="the-algorithms">The Algorithms</h3> + +<p>The two biggest “implementations” of public-key cryptography vary only in the mathamatical equations used to generate the numbers, +and how the numbers are <a href="https://en.wikipedia.org/wiki/Trapdoor_function">“trapdoored”</a> to decrypt if you have the correct key.</p> + +<p>I will discuss the differences in approach here. +If you want to skip to the next article where I show you how to encrypt your own documents using RSA, see <a href="/2020/04/06/rsa4.html">this link</a>.</p> + +<h3 id="rsa">RSA</h3> + +<p>The mathamatic center of the RSA system was developed over the course of a year or so. +Three men were involved. Ron Rivest, Adi Shamir, and Leonard Aldeman. +They worked as a kind of “team”: Each idea by Rivest and Shamir were critisized by the mathamatician on their team: Mr. Aldeman.</p> + +<p>One night, after consuming +<a href="https://www.math.uchicago.edu/~may/VIGRE/VIGRE2007/REUPapers/FINALAPP/Calderbank.pdf">“liberal quantities of Manischewitz wine”</a> +Rivest had trouble sleeping. +After taking long gazes into the abyss of his math textbook, he came up with an idea which would change cryptography forever. +By the next morning, an academic mathamatical paper was nearly finished. +He named it after himself and the two others that had been helping him along this whole time. <em>Rivest, Shamir, Aldeman</em>.</p> + +<p>Key sizes of RSA range from 1024-bit to 4096-bit. +1024-bit keys are considered somewhat insecure. +However, +it should be noted that every bit doubles the complexity of the key, +so 2048 is <a href="https://www.wolframalpha.com/input/?i=2%5E1024">2^1024</a> times more complex than 1024.</p> + +<h3 id="eliptic-curve-ec">Eliptic-Curve (EC)</h3> + +<p>Eliptic-Curve (EC) is a family of algorithms that use the <a href="https://en.wikipedia.org/wiki/Elliptic_curve">Eliptic curve</a> mathamatical structure to generate the numbers for the keys. +EC can effectivly provide the security of an RSA key <a href="https://www.youtube.com/watch?v=NF1pwjL9-DE">one order of magnitude larger</a> than an RSA key.</p> + +<figure> + <img src="/assets/img/ec.png" alt="A picture of an eliptic curve." class="small-image" /> + <figcaption> + An eliptic curve structure. + </figcaption> +</figure> + +<p>It’s fast; it’s secure! Perfect right?</p> + +<p>Of course not!</p> + +<p>One problem is that due to the smaller key size, +it can more easily be broken by brute-force. +This is why EC is mostly used for temporary communication (like HTTPS), not permenant communication (like having an encrypted email conversation with a journalist).</p> + +<p>The other problem is that a certain EC algrorithm called P-256 is suspected to be introduced with malice to National Institute of Standards and Technology (NIST) +<a href="https://www.schneier.com/essays/archives/2007/11/did_nsa_put_a_secret.html">by the NSA</a>. +Supposedly, the NSA is able to crack anything encrypted with this algorithm. +I will let the experts argure about that.</p> + +<p>Other well-known EC algorithms that are more-or-less trusted as secure do exist though. +The premeire one being Curve25519. +The reference implementation of <a href="https://cr.yp.to/ecdh.html">this algrorithm</a> is also <a href="https://fairuse.stanford.edu/overview/public-domain/welcome/">public-domain</a>, +so it is easy for devlopers to work into their own applications without worrying about copywrite.</p> + +<h2 id="conslusion">Conslusion</h2> + +<p>In this article we went over some basic points:</p> + +<ol> + <li>Public-key encryption enables secure communication over insecure networks.</li> + <li>RSA is considered the standard for extra-seure communication.</li> + <li>EC is a newer, faster, more transient encryption method.</li> +</ol> + +<p>To learn how to use RSA keys to encrypt your own communications, check out <a href="/2020/04/06/rsa4.html">this other aritcle I wrote</a>.</p>taitIn a few previous articles I have explained why encryption may be important to you and how the theory behind encryption works. I did not yet explain the system of asymetric cryptography, however. That is what this article is for.How Does Encryption Work, in Theory?2020-02-19T00:00:00+00:002020-02-19T00:00:00+00:00http://localhost:4000/2020/02/19/rsa2<p>There are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in <a href="/2020/01/26/rsa1.html">this article</a> why encryption is important, and why <em>you</em> should care about it.</p> <p>We will start by looking at in-person, offline encryption.</p> @@ -139,7 +619,7 @@ I will discuss this more in another article, but for the technically inclined:&l <ol> <li><a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)">RSA</a>/<a href="https://en.wikipedia.org/wiki/Elliptic-curve_cryptography">EC</a> provides <em>very</em> large cryptographic keys. It would be impossible for a human to encrypt or decrypt a message manually.</li> <li><a href="https://www.youtube.com/watch?v=GSIDS_lvRv4">Asymetric cryptography</a> provides four keys, instead of just one; stopping evesdroppers from listening in on your secret conversations—even if you do not have the chance to exchange keys in advance.</li> -</ol>taitThere are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in this article why encryption is important, and why you should care about it.Is Encryption Worth It?2020-01-26T00:00:00+00:002020-01-26T00:00:00+00:00/2020/01/26/rsa1<p>What is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your business’s secret to stay ahead of the competition?</p> +</ol>taitThere are many kinds of encryption used in our everyday communication. Online and offline, over the internet and in person. In this article, I will explain the basics of how encryption should work in theory. I explain in this article why encryption is important, and why you should care about it.Is Encryption Worth It?2020-01-26T00:00:00+00:002020-01-26T00:00:00+00:00http://localhost:4000/2020/01/26/rsa1<p>What is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your business’s secret to stay ahead of the competition?</p> <p>Now at first these questions may seem not completely related. There is a point though: You likely sent all of this information over the internet.</p> @@ -188,7 +668,7 @@ Japan lags slightly behind with 80 percent encrypted traffic.</p> <h3 id="what-about-rsa">What about RSA?</h3> -<p>RSA is an encryption method named after the initials of the inventors’ sir names: Ron <strong>R</strong>ivest, Adi <strong>S</strong>hamir, and Leonard <strong>A</strong>dleman. It uses the mathematical “factoring problem” to secure communication. The details of this specific type of encryption will be discussed in an article soon to come.</p>taitWhat is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your business’s secret to stay ahead of the competition?Padding And Margin2020-01-22T00:00:00+00:002020-01-22T00:00:00+00:00/2020/01/22/padding-and-margin<p>Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</p> +<p>RSA is an encryption method named after the initials of the inventors’ sir names: Ron <strong>R</strong>ivest, Adi <strong>S</strong>hamir, and Leonard <strong>A</strong>dleman. It uses the mathematical “factoring problem” to secure communication. The details of this specific type of encryption will be discussed in an article soon to come.</p>taitWhat is the most embarassing thing you have typed into Google search? What is the most personal secret you told a friend in confidence? What is your bank password? What is your business’s secret to stay ahead of the competition?Padding And Margin2020-01-22T00:00:00+00:002020-01-22T00:00:00+00:00http://localhost:4000/2020/01/22/padding-and-margin<p>Many people have expressed confusion over how padding and margins work in HTML/CSS. I have been one of those people. In this short article I will explain what the differences are between the two, and how it may affect the functionality of your site.</p> <p>Here is an image from the World Wide Web Consortium (W3C) who sets the standards for the web.</p> diff --git a/_site/robots.txt b/_site/robots.txt index e087884..d297064 100644 --- a/_site/robots.txt +++ b/_site/robots.txt @@ -1 +1 @@ -Sitemap: /sitemap.xml +Sitemap: http://localhost:4000/sitemap.xml diff --git a/_site/sitemap.xml b/_site/sitemap.xml index f106344..bb891d5 100644 --- a/_site/sitemap.xml +++ b/_site/sitemap.xml @@ -1,30 +1,38 @@ -/2020/01/22/padding-and-margin.html +http://localhost:4000/2020/01/22/padding-and-margin.html 2020-01-22T00:00:00+00:00 -/2020/01/26/rsa1.html +http://localhost:4000/2020/01/26/rsa1.html 2020-01-26T00:00:00+00:00 -/2020/02/19/rsa2.html +http://localhost:4000/2020/02/19/rsa2.html 2020-02-19T00:00:00+00:00 -/2020-01-23-sql-joins.html +http://localhost:4000/2020/04/02/rsa3.html +2020-04-02T00:00:00+00:00 -/podcast/ +http://localhost:4000/2020/04/06/rsa4.html +2020-04-06T00:00:00+00:00 -/blog/ +http://localhost:4000/2020-01-23-sql-joins.html -/links/ +http://localhost:4000/podcast/ -/ +http://localhost:4000/blog/ + + +http://localhost:4000/links/ + + +http://localhost:4000/ diff --git a/assets/img/alice-sign-to-bob.png b/assets/img/alice-sign-to-bob.png new file mode 100644 index 0000000..cfce6bf Binary files /dev/null and b/assets/img/alice-sign-to-bob.png differ diff --git a/assets/img/alice-to-bob.png b/assets/img/alice-to-bob.png new file mode 100644 index 0000000..eaf5e64 Binary files /dev/null and b/assets/img/alice-to-bob.png differ diff --git a/assets/img/ec.png b/assets/img/ec.png new file mode 100644 index 0000000..c7532a2 Binary files /dev/null and b/assets/img/ec.png differ diff --git a/assets/img/keyring.jpg b/assets/img/keyring.jpg new file mode 100644 index 0000000..279c46d Binary files /dev/null and b/assets/img/keyring.jpg differ diff --git a/assets/img/public-key-example1.svg b/assets/img/public-key-example1.svg new file mode 100644 index 0000000..a9220e8 --- /dev/null +++ b/assets/img/public-key-example1.svg @@ -0,0 +1,201 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 鮑伯 + 你好! + + + Hello + Bob! + + + + + + 鮑伯的 + 私有密鑰 + + + Bob's + Private Key + + + + + 加密 + Encrypt + + + 6EB6957008E03CE4 + + + + + 鮑伯 + 你好! + + + Hello + Bob! + + + + + 解密 + Decrypt + + + + + 鮑伯的 + 公開金鑰 + + + Bob's + Public Key + + + + 愛麗斯 + Alice + + + + 鮑伯 + Bob + + + + + + + + diff --git a/assets/img/wget-log b/assets/img/wget-log new file mode 100644 index 0000000..6e8c91c --- /dev/null +++ b/assets/img/wget-log @@ -0,0 +1,12 @@ +--2020-04-02 20:52:24-- https://www.google.com/url?sa=i +Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' +Resolving www.google.com (www.google.com)... 172.217.3.196, 2607:f8b0:400a:809::2004 +Connecting to www.google.com (www.google.com)|172.217.3.196|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: unspecified [text/html] +Saving to: 'url?sa=i' + + url?sa=i [<=> ] 0 --.-KB/s url?sa=i [ <=> ] 1.38K --.-KB/s in 0s + +2020-04-02 20:52:24 (10.1 MB/s) - 'url?sa=i' saved [1414] +