---
# System prepended metadata

title: Practical Cryptography 109

---

# Practical Cryptography 109

Crypto is just a fancy word for **number secrets**. 

It might seem like it's a new thing because now all crypto runs on computers, but crypto is actually *much older than the computer!*

Here are some examples of ancient and modern cryptography:

![skytale](https://upload.wikimedia.org/wikipedia/commons/5/51/Skytale.png)
Ancient greek device called a "Skytale"

![16th century cypher](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/16th_century_French_cypher_machine_in_the_shape_of_a_book_with_arms_of_Henri_II.jpg/1920px-16th_century_French_cypher_machine_in_the_shape_of_a_book_with_arms_of_Henri_II.jpg)
16th century cypher machine from France


![enigma machine](https://upload.wikimedia.org/wikipedia/commons/a/ae/Enigma.jpg)
The famous "enigma" machine used by the Germans in WWII -- and cracked by the grandfather of the computer, [Alan Turing](https://en.wikipedia.org/wiki/Alan_Turing)


## Pick a Number, Any Number
It sounds silly, but you should do it right now. You must think of a number, and keep it secret. 

Pick a number between 0 and 99, and remember it, but keep it secret!

Now that you have a number, I want you to try and guess one of your friend's numbers. Go ahead, pick one other person in the (chat)room and try to guess their secret number. The rules of this game are simple
...
...
....
.....
......
Was anyone able to guess someone else's number? How many guesses would it take to be *SURE* you will find the right number? 

...
...
...
If everyone chooses a number between 0 and 99, we only need a *maximum* of 99 guesses to find it. That's not very secure! So we will make the game harder. 

Now, think of a number between 0 and 10,000

This one is harder to guess, right? How many guesses would it take you to find a friend's secret number now? How long would it take to guess? How long would it take *a computer* to guess? 

...
... 
...
...

## Eve is always evesdropping (listening) 

![gladdos](https://upload.wikimedia.org/wikipedia/en/b/bf/Glados.png)

This is Eve. Eve is your imaginary enemy on the internet. She is always watching your communications on the network. Always listening. Because she is a super-powerful AI, Eve can intercept any communication you try to send. She's watching what you post on facebook, she's keeping track of what Passport your SIM card is registered to, and she's listening to all of your phone calls. 

Thankfully, we can use crypto to be safe from Eve. 

Eve is made of computers, so she can try to guess our secret numbers really, really fast. How fast? If Eve has all of Google's supercomputers, she can guess *billions* of times in a single second. 

To keep our secret numbers **truly secret**, we need to choose the secret number from a **really large set of numbers**. 

Modern crypto keys are made from a random number in-between 0 and 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

How many guesses would it take to find this new secret number? 

2^256 = 2^32 * 2^32 * 2^32 * 2^32 * 2^32 * 2^32 * 2^32 * 2^32

To get a sense of this number, you can watch this youtube video: [How big is 2^256](https://youtu.be/S9JGmA5_unY)

It takes a little bit to be sure, but this number is *so large* that nobody, not even Eve, has a hope of guessing the secret correctly. 

## The Magic Lock and Key :lock_with_ink_pen: 
The basic building block of a crypto-system is a "one-way function": a mathematical operation that is very easy to do in one direction, but very difficult to do in the opposite direction. It's not necessary to understand the math, but if you're curious about it you can always watch [this fun series on the fundamentals of cryptography](https://www.youtube.com/watch?v=lICOtR078Gw). One way functions are a way to mix numbers like paints: It's easy to mix two of them together, but very difficult to separate a single one back into its original components again.

![](https://storage.googleapis.com/ethereum-hackmd/upload_47cbba49d3a349abaac9ad0000309a80.png)

In modern crypto, the one-way function helps us to creat a magical lock and key: By combining secret numbers in the right way, we can hide information from Eve (who doesn't have the key). 

Let's shift over to [Eth.Build](https://eth.build) to learn more about how this lock and key works. 
 ... 
 ...
 
 
