Readings: Cryptography
Credit links: https://www.khanacademy.org/computing/computers-and-internet/xcae6f4a7ff015e7d:online-data-security/xcae6f4a7ff015e7d:data-encryption-techniques/a/encryption-decryption-and-code-cracking
https://en.wikipedia.org/wiki/Caesar_cipher
Three aspects of Cryptography:
- Encryption: scrambling the data according to a secret pattern, for example shift positions to another letters
- Decryption: recover the original data from scrambled data by using the right pattern.
- Code cracking: using modern technologies to uncover the original data without knowing the pattern first.
Caesar Cipher
Also called Caesar shift, it is a substitute cipher which replace message letters in a certain pattern, normally shift original letters left or right a number of positions and replace with new letters.
"If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters
of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning,
he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others."
— Suetonius, Life of Julius Caesar 56
Decryption
Three popular decryption methods:
- Frequency analysis: analyze the frequency of characters and narrow down to the most used popular letters.
- Known plaintext: find out the plaintext, and use it to decode the rest of the message.
- Brute force: Simply try everything cipher possibilities until find out the right pattern.
Things I want to know more How to decipher encrypted messages using python code? is there any popular libs to do this?