---
title: "Symmetric cryptography, substitution, Caesar"
subject: "Operating System"
chapter: 8
key: "semester_6/operating_system:symmetric-cryptography-substitution-caesar"
source: https://www.bctengineer.com/q/semester_6/operating_system/symmetric-cryptography-substitution-caesar
site: BCT Engineering
---

# Symmetric cryptography, substitution, Caesar

Operating System · Chapter 8: Security

- Asked in: year not given
- Video: [Symmetric Key Cryptography: Cryptographic Techniques](https://www.youtube.com/watch?v=djqFWKJKShc) — Computer Science Lessons
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/symmetric-cryptography-substitution-caesar
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-8

## Question

Explain symmetric cryptography. Also explain mono-alphabetic substitution and Caesar cipher.

## Short answer

In symmetric cryptography, the same key encrypts and decrypts data (C=E(K,P), P=D(K,C)). It is fast but suffers from key distribution problems. Mono-alphabetic substitution replaces each letter with a fixed mapping (key space 26!), breakable by frequency analysis. Caesar cipher is a special case, shifting letters by k (mod 26), with just 25 keys.

## Answer

#### Symmetric cryptography
In **symmetric (secret-key) cryptography** the same key is used to encrypt and to decrypt: C = E(K, P) and P = D(K, C). The sender and the receiver must share the key beforehand over a secure channel. Examples: DES, 3DES, AES, Blowfish.

```text
 P --[Encrypt, K]--> C --(channel)--> [Decrypt, K]--> P
```

- Advantages: fast, suitable for large data.
- Disadvantages: key distribution problem; n users need n(n−1)/2 keys; no non-repudiation.
- Two kinds: **block ciphers** (fixed size blocks, e.g. 128 bits in AES) and **stream ciphers** (bit by bit).
- Classical techniques: substitution and transposition.

#### Mono-alphabetic substitution cipher
Each letter of the plaintext alphabet is replaced by another letter from a fixed one-to-one mapping (the key is a permutation of the 26 letters).

```text
Plain : 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
Cipher: Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
```
"attack" → "QZZQEA".

- Key space is 26! ≈ 4 × 10²⁶, too large for brute force.
- Weakness: letter frequencies of the language remain (e, t, a most common in English), so frequency analysis easily recovers the key.

#### Caesar cipher
A special mono-alphabetic cipher where each letter is shifted by a fixed *k* positions: C = (P + k) mod 26. With k = 3: A → D, B → E; "attack" → "DWWDFN". Only 25 keys, so it is broken at once by trying all shifts.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What defines symmetric cryptography?
   A. A public and private key pair
   B. No key is used
   C. The same key encrypts and decrypts
   D. Only a hash
   Answer: C. Examples: DES, AES. (Key point: Symmetric)

2. How many keys do n users need?
   A. n
   B. 2n
   C. n^2
   D. n(n-1)/2
   Answer: D. One key per pair of users. (Key point: Keys needed)

3. What is the weakness of mono-alphabetic substitution?
   A. Letter frequencies remain, so frequency analysis recovers the key
   B. Its key space of 26! is small
   C. It needs a shared public key
   D. It can encrypt only 3 letters
   Answer: A. Brute force is infeasible but frequencies leak. (Key point: Mono-alphabetic)

4. How does Caesar relate?
   A. Uses 26! keys
   B. Special case with fixed shift k, only 25 keys
   C. Uses two keys
   D. Is a block cipher
   Answer: B. Trying all shifts breaks it. (Key point: Caesar)

## Related in Operating System

- [Short note: Caesar cipher](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Acaesar-cipher-note) — Operating System, chapter 8
