Frequency Analysis
Letter frequency in the current text (useful for breaking unknown ciphers)
Help
How Does the Caesar Cipher Work?
The Caesar Cipher shifts each letter in the alphabet by a fixed number of positions.
Example with shift 3:
- A → D
- B → E
- C → F
- ...
- X → A (wraps around)
- Y → B
- Z → C
Message: "HELLO" → "KHOOR" (with shift 3)
Formula: New_Position = (Old_Position + Shift) mod 26
What is ROT13?
ROT13 is a Caesar cipher with shift 13.
Special property: ROT13 is self-inverse!
- Encrypt: ROT13("HELLO") = "URYYB"
- Decrypt: ROT13("URYYB") = "HELLO"
- Same operation for encryption and decryption!
Why it works: 13 is half of 26, so shifting twice returns to the original position.
Uses: Hiding spoilers, obscuring (not securing) text, puzzle games
Not for security: Trivially breakable!
Why is the Caesar Cipher Weak?
The Caesar Cipher is extremely weak and should never be used for real security:
1. Limited key space:
- Only 25 possible shifts (shift 0 and 26 are same as plaintext)
- Can try all possibilities in seconds
2. Frequency analysis:
- Letter frequencies remain unchanged
- Most common letter in ciphertext likely represents E
- Can break cipher by analyzing letter patterns
3. Pattern preservation:
- Word lengths unchanged
- Double letters preserved (HELLO → KHOOR, LL → OO)
- Common words recognizable by pattern
What is Frequency Analysis?
Frequency analysis is a technique to break substitution ciphers by analyzing letter frequencies.
English letter frequencies (most common):
- E (~13%)
- T (~9%)
- A (~8%)
- O, I, N (~7-8%)
- S, H, R (~6-7%)
How to break Caesar cipher:
- Count letter frequencies in ciphertext
- Most common letter likely represents E
- Calculate shift needed to map that letter to E
- Decrypt entire message with that shift
- Verify result is readable English
Limitations: Needs longer text (~100+ characters) for accurate results
How Does Brute Force Work?
Brute force means trying all possible solutions.
For Caesar cipher:
- Try all 25 possible shifts (1-25)
- Decrypt the message with each shift
- Look for readable English text
- One of them will be the correct plaintext!
Why it works: Only 25 possibilities to check - very fast!
Detection: The tool highlights likely plaintexts by checking for common English words.
Modern ciphers: Brute force doesn't work on AES-256 (2^256 possibilities would take longer than age of universe)
Historical Uses
Julius Caesar (50 BCE):
- Used shift 3 to communicate with generals
- Security came from enemies not knowing the system
- Most people couldn't read Latin anyway
ROT13 (1980s-90s):
- Used on Usenet to hide spoilers and offensive content
- Never intended for security, just obscuration
- Still used in some contexts (geocaching hints)
Educational:
- Teaches basic cryptography concepts
- Demonstrates substitution ciphers
- Shows importance of key space
- Illustrates frequency analysis
When Should I Use This?
✅ Appropriate uses:
- Learning cryptography concepts
- Puzzle games and challenges
- Non-secret text obfuscation
- Educational demonstrations
- Historical reenactment
❌ Never use for:
- Password storage
- Sensitive communications
- Financial data
- Personal information
- Anything requiring real security
Modern alternatives: Use AES-256, RSA-2048, or other modern encryption algorithms for actual security needs.