reading-notes

My reading notes journal for Code Fellows

View the Project on GitHub

READ CLASS 18: Readings: Cryptography

Encryption, Decryption, and Hacking

One of the earliest encryption techniques is the Caesar Cipher. Caesar always used a shift of 3. As long as his message recipient knew the shift amount, it was trivial for them to decode the message. 

Assume shift of 3

A	B	C	D	E	F	G	H	I	J	K	L	M	N	O	P	Q	R	S	T	U	V	W	X	Y	Z
D	E	F	G	H	I	J	K	L	M	N	O	P	Q	R	S	T	U	V	W	X	Y	Z	A	B

The first letter “E” was shifted by 3 from “B”, the second letter “H” was shifted by 3 from “E”

Frequency analysis

Human languages tend to use some letters more than others. For example, “E” is the most popular letter in the English language. We can analyze the frequency of the characters in the message and identify the most likely “E” and narrow down the possible shift amounts based on that.

Known plaintext

Another term for the original unencrypted message is plaintext. If the enemy already knew some part of the plaintext, it will be easier for them to crack the rest of the encrypted version.

For example, messages tend to start with similar beginnings. In WWII, encrypted German messages always started with a weather forecast, which ultimately made them easier for British mathematician Alan Turing to crack.

Brute force

There are only 25 possible shifts (not 26 — why not?). The enemy could take some time to try out each of them and find one that yielded a sensible message. They wouldn’t even need to try the shifts on the entire message, just the first word or two.

Assuming shift of 14

Original	A	B	C	D	E	F	G	H	I	J	K	L	M	N	O	P	Q	R	S	T	U	V	W	X	Y	Z
Shifted	O	P	Q	R	S	T	U	V	W	X	Y	Z	A	B	C	D	E	F	G	H	I	J	K	L	M	N

Cited from: https://www.khanacademy.org/computing/computers-and-internet/xcae6f4a7ff015e7d:online-data-security/xcae6f4a7ff015e7d:data-encryption-techniques/a/encryption-decryption-and-code-cracking 

Things I want to know more about

I want to better understand the frequency analysis method it seems to be the most accurate method to use but I’m not really sure how it works. Until I can understand better understand frequency analysis known plaintext is the approach I would take.

REFERENCES