1/28
Looks like no tags are added yet.
What are the Simple Ciphers?
Caesar, Vignere, Substitution
How Can Attacker Break Ciphers?
Brute Force, Frequency Analysis, Kasiki Test, and Index of Coincidence
Cryptography
Science of secret communication
Cipher
An algorithm used for encryption
Plaintext
Original Message (M)
Ciphertext
Encrypted Message (C)
Correctness
Dec(k, Enc(k,m)) = m
Decrypting will get the original message back
Kerckhoffs’ Principle
An attacker can know everything except the key. This means don’t rely on hiding your algorithm; only the key should be secret.
Caeser Cipher
Letters become numbers
Formula:
(Enc(k, m) = (m + k)(mod 26) → Encryption
(Dec(k, c) = (c - k)(mod 26) → Decryption
Caeser Cipher Drawback
Since the key space is 26, there are 26 possible keys and an attacker can try all of them until something looks like English (Brute Force Attack).
Frequency Analysis
Some letters appear more often then others, attackers will compare ciphertext frequencies with English frequencies.
Vignere Cipher
Better than Caeser, that uses a KEYWORD to shift letters, continually rotating through multiple Caesar ciphers.
Why Vignere is Better
Same plaintext can encrypt differently, makes frequency analysis harder.
How to Break Vignere
1) Find key length
2) Split ciphertext
3) Do frequency analysis on each piece
Kasiki Test
Used to find the key length of password by identifying repeated sequences of letters in the ciphertext like Vignere
How Kasiki Test Works
1) Find the repeated 3-letter pattern
2) Measure distances
3) Compute GCD
Index of Coincidence
The probability 2 randomly chosen letters are the same, used to determine if the guessed key length is correct.
Index of Coincidence Scores
English: IC = 0.065 (high score); indicates text encrypted with a single alphabet, simple substitution cipher.
Random Text: IC = 0.038 (low score); meaning the text mimics a completely random distribution of the 26-letter English alphabet (1 / 26 ≈ 0.0385), indicates a polyalphabetic cipher (like Vigenère).
Weakness of Index of Coincidence
Language dependent, fails on texts under 50-100 characters.
General Substitution Cipher
Instead of shifting letters by a fixed number, completely shuffle the alphabet. In this the total key space/arrangments is 26! (very big)
General Substitution Cipher Pros
Huge key space
Secure against Brute Force
General Substitution Cipher Cons
Preserves language patterns so frequency analysis still works
One-Time Pad (OTP)
Uses XOR (exclusive OR) which compares 2 bits and outputs 1 if different and 0 if they are the same.
OTP Encryption/Decryption
Encryption: c = m ⊕ k
Decryption: m = k ⊕ c
OTP Pros
Perfectly Secure
Easy XOR operations
Learns nothing from ciphertext
OTP Cons
It is a little impractical as:
Requires a truly random key as long as the message
Has a strict one-time usage
Must be random
Msut be shared beforehand
Conditions for Perfect Security
1) Truly Random Key
2) Key Length = Message Length
3) Key used exactly once
Why can't you reuse an OTP key?
Reusing an OTP key allows attackers to XOR multiple ciphertexts together, canceling out the key and potentially revealing information about the original messages.
Perfect Secrecy
P[M = m | C =c] = P[M = m]
Seeing the ciphertext gives ZERO information about the plaintext