Computer Networks (UGC NET topics) · Network Security
Symmetric Key Cryptography
Overview
Symmetric key cryptography is the branch of cryptography in which the same secret key is used for both encryption and decryption.
It is the oldest and fastest form of encryption and is used for bulk data protection in networks, disks, and secure protocols.
In the UGC NET Computer Networks syllabus it falls under Network Security and is tested through direct parameters, algorithm matching, modes of operation, classical ciphers, and key-count problems.
Before studying it, you should be comfortable with binary and bit lengths, modular arithmetic, the idea of plaintext and ciphertext, and the difference between substitution and rearrangement.
Key concepts
- Symmetric key encryption: encryption function and decryption function use the same secret key . The key must be shared securely between sender and receiver.
- Plaintext, ciphertext, key: plaintext is the original message; ciphertext is the encrypted message; the key is the secret value controlling the transformation.
- Block cipher: processes a fixed-size block of plaintext at a time, e.g. 64 or 128 bits. Stream cipher: processes plaintext bit-by-bit or byte-by-byte, usually by XOR with a keystream.
- Classical substitution cipher: replaces each plaintext symbol by another symbol.
Monoalphabetic substitution always maps the same plaintext character to the same ciphertext character regardless of position, e.g. Caesar, multiplicative, affine.
Polyalphabetic substitution maps the same plaintext character differently depending on its position, e.g. Vigenère; the mapping is one-to-many. - Transposition cipher: keeps the letters unchanged but rearranges their positions. Columnar transposition writes plaintext row-wise into a grid and reads columns in the order given by a keyword.
- DES (Data Encryption Standard): 64-bit block, 64-bit nominal key of which 8 bits are parity, so 56-bit effective key; 16 Feistel rounds. The round function order is expansion permutation, XOR with round key, S-box substitution, straight permutation.
- 3DES (Triple DES): applies DES three times, usually in EDE form . Two-key 3DES has and effective key 112 bits; three-key 3DES has effective key 168 bits. Block size remains 64 bits.
- AES (Advanced Encryption Standard): based on Rijndael; fixed 128-bit block; key sizes 128, 192, 256 bits; rounds 10, 12, 14 respectively. It is a substitution-permutation network, not a Feistel network.
- IDEA: 64-bit block, 128-bit key, 8 rounds followed by an output transformation. Blowfish: 64-bit block, variable key 32–448 bits, 16 Feistel rounds.
RC5: parameterized block size, key size and rounds; a common exam convention lists its key size as 128–256 bits. - Mode of operation: a method for using a block cipher on messages longer than one block. ECB encrypts each block independently and leaks patterns.
CBC chains blocks using an IV. CFB is a self-synchronizing stream mode. OFB and CTR are stream-like modes; CTR is fully parallelizable. - Key distribution problem: for users who need pairwise secret communication, the number of symmetric keys required is .
- Security services: symmetric encryption gives confidentiality; with a MAC it can give integrity and authentication; it does not by itself give non-repudiation.
How it works
- Symmetric encryption flow: sender and receiver share a secret key . Sender computes and sends . Receiver computes using the same . Anyone without cannot recover .
- DES round function: DES first applies an initial permutation, then performs 16 Feistel rounds, then a final permutation.
In each round the 32-bit right half is expanded to 48 bits, XORed with a 48-bit round subkey, passed through eight S-boxes (6 bits to 4 bits each), and permuted by a P-box. The two halves are swapped except after the last round.
The key schedule derives 16 48-bit subkeys from the 56-bit key. - AES procedure: the 128-bit block is placed in a 4×4 state matrix. Each round applies SubBytes (S-box), ShiftRows, MixColumns, and AddRoundKey. The last round omits MixColumns.
Key expansion generates round keys from the 128/192/256-bit key. The number of rounds is , where is the key length in 32-bit words (4, 6, 8), giving 10, 12, 14 rounds. - CBC mode: choose an initialization vector ; set ; for each plaintext block , compute . Decryption is .
Identical plaintext blocks encrypt differently because of chaining; encryption is sequential, decryption can be parallelized. - CFB mode: with . Decryption is . Because the keystream depends on previous ciphertext, CFB is a self-synchronizing stream cipher: after a bounded loss of ciphertext, decryption regains synchronization.
- OFB and CTR modes: OFB repeatedly encrypts the IV to produce a keystream; CTR encrypts a nonce and counter values to produce keystream blocks.
In CTR, ciphertext blocks can be encrypted/decrypted in parallel; reusing the same nonce and counter with the same key is catastrophic. - Columnar transposition: write plaintext row-wise in a grid with a keyword. Number the keyword letters alphabetically; read columns in that order to form ciphertext. Padding characters such as Z may be used.
Drawing the diagram…
Formulas
- Symmetric key count for users: , where is the number of distinct pairwise secret keys.
- Caesar cipher with A=0, B=1, ..., Z=25: encryption ; decryption .
- Multiplicative cipher: , with ; decryption .
- AES rounds: , where for 128, 192, 256-bit keys, so .
- DES effective key: bits, because 8 parity bits are removed.
- CBC encryption: , .
- CFB encryption: , .
- CTR encryption: .
- 3DES EDE: ; effective key 112 bits for two-key and 168 bits for three-key 3DES.
Worked examples
Example 1 (DES parameters). In DES, state the plaintext block size, effective secret key length, and number of Feistel rounds.
- Block size = 64 bits.
- Nominal key = 64 bits; 8 parity bits removed; effective key = 56 bits.
- Rounds = 16.
Answer: 64-bit block, 56-bit effective key, 16 rounds.
Example 2 (AES rounds). For AES with a 192-bit key, how many transformation rounds are performed?
- 192-bit key = 192/32 = 6 words, so .
- .
Answer: 12 rounds.
Example 3 (key count). Ramesh's team has 10 employees who all need pairwise secret communication using symmetric encryption. How many distinct secret keys are needed?
- Number of unordered pairs = .
Answer: 45 keys.
Example 4 (multiplicative cipher). Using A=0, B=1, ..., Z=25 and , encrypt the letter H and decrypt the resulting letter.
- H = 7; ; 23 = X.
- Inverse of 7 mod 26 is 15 because .
- Decrypt X: ; 7 = H.
Answer: H encrypts to X, and X decrypts back to H.
Example 5 (columnar transposition). Encrypt EXTRANET with column order 3,5,2,1,4 and pad with Z.
- Block 1: E X T R A. Read positions 3,5,2,1,4: T, A, X, E, R →
TAXER. - Block 2: N E T Z Z (two Z pads). Read positions 3,5,2,1,4: T, Z, E, N, Z →
TZENZ. - Ciphertext:
TAXERTZENZ.
Answer:TAXERTZENZ.
Example 6 (match-the-list). Match DES, AES, 3DES, and RSA with 56-bit key, 256-bit key, 168-bit key, and asymmetric key.
- DES → 56-bit effective key.
- AES → supports 128/192/256; among these, 256-bit key.
- 3DES → three-key effective key 168 bits.
- RSA → public-key/asymmetric algorithm.
Answer: DES–56, AES–256, 3DES–168, RSA–asymmetric.
Comparison
| Feature | Symmetric key | Asymmetric key |
|---|---|---|
| Keys | Same secret key for both directions | Public key and private key pair |
| Speed | Fast; used for bulk data | Slow; used for small data/key exchange |
| Key distribution | Difficult; many pairwise keys | Public key can be published |
| Non-repudiation | Not by itself | Yes, with digital signatures |
| Examples | DES, 3DES, AES, IDEA, Blowfish | RSA, ECC, Diffie-Hellman key exchange |
| Cipher type | Mapping property | Example | Effect |
|---|---|---|---|
| Monoalphabetic substitution | One-to-one, position-independent | Caesar, multiplicative, affine | Same plaintext letter always becomes same ciphertext letter |
| Polyalphabetic substitution | One-to-many, position-dependent | Vigenère | Same plaintext letter can become different ciphertext letters |
| Transposition | Rearranges positions; letters unchanged | Columnar transposition | Frequency of letters unchanged; order changed |
| Algorithm | Block size | Key size | Rounds | Structure/notes |
|---|---|---|---|---|
| DES | 64 bits | 56 effective (64 nominal) | 16 | Feistel |
| 3DES | 64 bits | 112 (2-key) or 168 (3-key) | 3 DES operations | EDE |
| AES | 128 bits | 128/192/256 bits | 10/12/14 | SPN, Rijndael |
| IDEA | 64 bits | 128 bits | 8 + output transform | Mixing operations |
| Blowfish | 64 bits | 32–448 bits | 16 | Feistel |
| RC5 | Variable | 0–2040 bits; exam often 128–256 | Variable | Parameterized |
| Mode | Core idea | Pattern hiding | Parallel encryption | Key property |
|---|---|---|---|---|
| ECB | Encrypt each block independently | No | Yes | Leaks patterns; deterministic |
| CBC | Chain with previous ciphertext | Yes | No (decryption can parallel) | IV needed; error affects two blocks |
| CFB | Ciphertext feedback | Yes | No | Self-synchronizing stream mode |
| OFB | Output feedback keystream | Yes | Keystream can be precomputed | Not self-synchronizing |
| CTR | Counter-based keystream | Yes | Yes | Nonce reuse is catastrophic |
Revision summary
- DES: 64-bit block, 56-bit effective key, 16 Feistel rounds.
- DES round function order: expansion, XOR, S-boxes, straight permutation.
- AES: always 128-bit block; keys 128/192/256; rounds 10/12/14.
- 3DES EDE: two-key effective 112 bits, three-key effective 168 bits.
- Blowfish: 64-bit block, 32–448-bit key, 16 rounds.
- IDEA: 64-bit block, 128-bit key, 8 rounds plus output transform.
- Symmetric key count: ; for 10 users, 45 keys.
- ECB leaks patterns; CBC hides patterns by chaining with an IV.
- CFB is the self-synchronizing stream mode; OFB and CTR are not self-synchronizing.
- Monoalphabetic = one-to-one; polyalphabetic = one-to-many; transposition = rearrangement.
- Symmetric encryption gives confidentiality, not non-repudiation.
- Diffie-Hellman is key exchange; RSA is asymmetric; SHA-1 is a hash, not encryption.
Previous-year exam insights
- Direct parameter questions ask for DES block/key/rounds, AES key/round combinations, or the block and key sizes of IDEA, Blowfish, and RC5; memorise the standard table.
- Match-the-list questions pair algorithms with key sizes or design issues; distinguish DES (56), AES (128/192/256), 3DES (112/168), RSA (asymmetric), and SHA-1 (message digest).
- Mode questions ask which mode is self-synchronizing (CFB), which leaks patterns (ECB), which uses chaining (CBC), or which is parallelizable (CTR).
- False-statement questions often attack AES: AES supports 128/192/256, not 56 or 124; DES uses 56 effective bits, not 64.
- Key-count numericals use for symmetric pairwise communication; do not use unless directed communication and ordered keys are explicitly counted.
- DES round-function order is a common trap: expansion comes before XOR, S-boxes after XOR, P-box last.
- Classical cipher questions test Caesar decryption, multiplicative inverses, monoalphabetic versus polyalphabetic mapping, and columnar transposition reading order.
- Check the block size separately from the key size; AES block is always 128 bits even when the key is 192 or 256 bits.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- State DES block size, effective key size, and number of rounds without hesitation.
- List AES block size, all three key sizes, and the matching round counts.
- Explain why ECB leaks patterns and why CBC hides them.
- Identify CFB as a self-synchronizing stream mode and distinguish it from OFB and CTR.
- Compute the number of symmetric keys for users using .
- Encrypt and decrypt a letter using Caesar or a multiplicative cipher modulo 26.
- Perform a columnar transposition encryption with a given key order and padding.
- Match DES, 3DES, AES, IDEA, Blowfish, and RC5 with their standard block and key sizes.
- Explain why symmetric encryption does not provide non-repudiation, while digital signatures do.
- Distinguish symmetric algorithms from RSA, Diffie-Hellman, and SHA-1 in a match-the-list question.
Attempt the sub-topic test first, then the subject test.