SG3423
### Chapter 5: Cryptography
#### 5.1 Introduction
Cryptography is the intersection of security engineering and mathematics. It underpins most modern security protocols and is critical for protecting distributed systems. However, it is complex and often misunderstood. This chapter aims to provide a basic understanding of cryptographic principles and methods without delving too deeply into mathematics.
#### Key Terms:
- **Cryptography**: The design of ciphers.
- **Cryptanalysis**: The science of breaking ciphers.
- **Cryptology (Crypto)**: The study of both cryptography and cryptanalysis.
- **Plaintext**: The original unencrypted message.
- **Ciphertext**: The encrypted message.
- **Block Ciphers**: Encrypt fixed-size blocks of plaintext.
- **Stream Ciphers**: Encrypt plaintext one bit or byte at a time.
- **Shared-Key (Symmetric) Cryptography**: The same key is used for encryption and decryption.
- **Public-Key (Asymmetric) Cryptography**: Different keys are used for encryption and decryption.
- **Digital Signature Scheme**: A type of asymmetric crypto used for verifying authenticity.
#### 5.2 Historical Background
##### Early Stream Ciphers
- **Caesar Cipher**: Julius Caesar encrypted messages by shifting letters by a fixed number. For instance, with a shift of three, 'A' becomes 'D', 'B' becomes 'E', etc.
- **Vigenère Cipher**: Uses a repeating key to encrypt a message by shifting letters according to the key's corresponding letter values. For example, if the key is 'LEMON' and the plaintext is 'ATTACK', each letter of the plaintext is shifted according to the corresponding letter of the key.
##### Kasiski Examination
- Friedrich Kasiski developed a method to break the Vigenère cipher by finding repeating sequences of letters and analyzing the distances between them, which likely correspond to the key length.
##### One-Time Pad
- Proposed by Gilbert Vernam, the one-time pad uses a key as long as the message, which is never reused. This method is theoretically unbreakable if the key is truly random and kept secret. Each bit or character of the plaintext is combined with a bit or character from the key.
##### Example of One-Time Pad
Suppose the plaintext is "HELLO":
- Plaintext: `HELLO`
- Key: `XMCKL`
- Ciphertext: `EQNVZ`
##### Problems with One-Time Pad
- While providing perfect secrecy, the one-time pad requires a key that is as long as the message and must be securely distributed and kept secret.
##### Early Block Ciphers
- **Playfair Cipher**: Developed by Sir Charles Wheatstone and promoted by Baron Playfair. It uses a 5x5 grid of letters based on a keyword. Letters are encrypted in pairs:
- For letters in the same row or column, shift to the right or down respectively.
- For letters forming a rectangle, swap them with the letters at the other corners of the rectangle.
##### Example of Playfair Cipher
Using the keyword "MONARCHY":
- Plaintext: `BALLOON` (processed as `BA LX LO ON`)
- Key grid:
```
M O N A R
C H Y B D
E F G I K
L P Q S T
U V W X Z
```
- Ciphertext: `IB BN LY RR ON`
In conclusion, understanding these historical methods lays the groundwork for grasping modern cryptographic techniques. The key challenge in cryptography remains balancing security, usability, and computational efficiency.