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 [this article](/2020/01/26/rsa1.html) why encryption is important, and why *you* should care about it.
We will start by looking at in-person, offline encryption.
## Cryptography We Do Everyday
We encrypt things all the time without even thinking about it.
If you spend a significant amount of time with the same group of friends, you will tend to develop common codes that may not make sense to others outside the group.
For example: for years, my family called sombody falling from a sitting position "doing a Don". There is a story of course---We knew a guy named Don who fell from his plastic beach chair in a rather hilarious way; "doing a Don" was born.
> We say something other than what we mean, and then expect everyone is able to decipher the true meaning behind the words.
> Only, I never do..." --- Adapted from a scene in [The Imitation Game (p. 39-40)](https://www.benedictcumberbatch.co.uk/wordpress/wp-content/uploads/ScreenplayTIG.pdf)
How many times have you hinted, flirted, and innuendoed to try to say "I find you very physically attractive"?
Have you ever had someone say the words "I'm fine" when you know *for certain* that they are indeed not okay?
Words Said | Meaning
--- | ---
What can you do? | I don't want to talk about this anymore.
I don't want to overstay my welcome. | I want to go home now.
I don't like them and don't know why. | They threaten my ego.
Creepy | Unattractive and friendly
All of these scenarios are perfect examples of ~~lies~~ encryption! If we have the key to these codes, we can start to understand what people really mean.
Hopefully I have convinced you that you use ~~deceit~~ cryptography on a regular basis in your life, so let us consider what a basic encryption method might be:
## Grade-School Encryption
Back when I was in middle school I used to pass notes like these:
<imgalt="A message I would have sent in middle school. ROT5: Xfwfm hx hzy"src="/assets/img/ceasar1.jpg">
<figcaption>
The kind of message I would have sent in middle school. A ROT5 Ceasar cipher.
</figcaption>
</figure>
This is a message encrypted using the Caesar cipher. This encryption technique was used by Julius Caesar during the reign of the Roman Empire to "encrypt messages of military significance."<aclass="citation-link"href="https://en.wikipedia.org/wiki/Caesar_chipher/">[1]</a>
Let us assume that Alice and Bob already have a shared key, 7 for example. To encrypt this message, she should shift her letters seven letters forward in the alphabet---just like the example above.
Now, when Alice sends her Romeo a little note, all he has to do is decrypt the text by shifting the letters down by 7.
[Here is a site](https://www.xarg.org/tools/caesar-cipher/) which can do longer pieces of text for you instead of doing it manually.
## Problems
Before the two love-birds start smooching on the branch of a big pine tree in the schoolyard, perhaps we should consider some problems with the Ceasar cipher.
Even Eve with her measly grade 4 math skills could easily start going through this message with pen and paper and figure out any combination in a couple hours at maximum.
If Bob and Alice did not have a previous friendship and time to share secrets of this sort, there is no way to share their key with eachother without Eve also knowing.
Every message sent between the two parties uses the same code to encrypt and decrypt. If someone finds out the code once, all previous communications are comprimised.
To combat the issues with easily breakable, shared-key cryptography, we can turn to the beautiful beast that is [Asymetric Cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography).
I will discuss this more in another article, but for the technically inclined:
1. [RSA](https://en.wikipedia.org/wiki/RSA_(cryptosystem))/[EC](https://en.wikipedia.org/wiki/Elliptic-curve_cryptography) provides *very* large cryptographic keys. It would be impossible for a human to encrypt or decrypt a message manually.
2. [Asymetric cryptography](https://www.youtube.com/watch?v=GSIDS_lvRv4) 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.