---
title: "Short note: cryptography"
subject: "Operating System"
chapter: 8
key: "semester_6/operating_system:cryptography-note"
source: https://www.bctengineer.com/q/semester_6/operating_system/cryptography-note
site: BCT Engineering
---

# Short note: cryptography

Operating System · Chapter 8: Security

- Asked in: 2071 Magh, 3 marks; 2073 Magh, 3.5 marks (asked 2 times)
- Video: [Cryptography](https://www.youtube.com/watch?v=6_Cxj5WKpIw) — Neso Academy
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/cryptography-note
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-8

## Question

Write a short note on cryptography.

## Short answer

Cryptography hides information by converting plaintext to ciphertext using keys, providing confidentiality, integrity, authentication, and non-repudiation. Symmetric cryptography uses one shared key (fast but key distribution is hard); asymmetric uses public/private key pairs (solves distribution but slower). Hash functions produce fixed-length digests for integrity checks and password storage.

## Answer

**Cryptography** is the science of hiding information by converting it into a form that unauthorised persons cannot read, so that only those who hold the secret key can recover it. It provides confidentiality, integrity, authentication and non-repudiation.

#### Terms
- **Plaintext (P):** the original readable message.
- **Ciphertext (C):** the scrambled message.
- **Encryption:** C = E(K, P). **Decryption:** P = D(K, C).
- **Key:** the secret value controlling the cipher. Kerckhoffs' principle: the algorithm is public; only the key is secret.

```text
 Plaintext --[Encrypt, key K1]--> Ciphertext --[Decrypt, key K2]--> Plaintext
```

#### Types
1. **Secret-key (symmetric) cryptography:** the same key is used for encryption and decryption (DES, 3DES, AES). Fast, but key distribution is a problem.
2. **Public-key (asymmetric) cryptography:** a pair of keys: the public key for encryption and the private key for decryption (RSA). Solves key distribution, but is slower.
3. **Hash functions (one-way):** produce a fixed-length digest (MD5, SHA-1, SHA-256); used for integrity checks and password storage.

#### Uses
Secure communication (SSL/TLS, VPN), digital signatures, password storage and encrypted file systems.

Classical ciphers include substitution (Caesar) and transposition ciphers.

## Check yourself

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

1. What does Kerckhoffs' principle say?
   A. Both the algorithm and key are secret
   B. The key is public; the algorithm secret
   C. The algorithm is public; only the key is secret
   D. Keys must be 26 letters long
   Answer: C. Security should rely on the key, not on hiding the algorithm. (Key point: Kerckhoffs)

2. Which pairs the type with its property?
   A. Symmetric: key pair, slow; public key: one key, fast
   B. Symmetric: hash, fixed length; public key: one key
   C. Both use one key but different algorithms
   D. Symmetric: same key, fast but key distribution is hard; public key: key pair, slower but solves distribution
   Answer: D. AES/DES share one key; RSA uses public and private keys. (Key point: Symmetric vs public key)

3. What is a hash function used for?
   A. One-way fixed-length digest for integrity and passwords
   B. Reversible encryption of big files
   C. Key exchange
   D. Providing a public key
   Answer: A. Hashes like MD5 and SHA-1 cannot be reversed. (Key point: Hash function)
