Courses / HEC NSCT – National Skill Competency Test: Complete Preparation for Computing Graduates
10.2 Cryptography Made Simple
Area 10 – Cyber Security (5%) · 45 min read · 55 MCQs to check yourself
Symmetric vs asymmetric
| Symmetric | Asymmetric (public key) | |
|---|---|---|
| Keys | One shared secret key | Public key + private key pair |
| Speed | Fast – good for bulk data | Slow – used for key exchange and signatures |
| Examples | AES, DES/3DES, ChaCha20 | RSA, ECC, Diffie–Hellman (key exchange) |
| Problem | How do we share the key safely? | Needs a way to trust public keys (PKI) |
- To send a secret message to Ali → encrypt with Ali's public key; only Ali's private key decrypts it.
- To sign a message → hash it and encrypt the hash with your private key; anyone can verify it with your public key.
- TLS/HTTPS uses both: asymmetric crypto to agree a session key, then symmetric (AES) for the data.
Hashing
A one-way function giving a fixed-size digest: SHA-256 (256 bits), SHA-1 (160, weak), MD5 (128, broken). Used for integrity checks and password storage. Store passwords as salted, slow hashes (bcrypt, scrypt, Argon2) – never in plain text. A salt defeats rainbow tables. HMAC = hash + secret key → integrity and authenticity.
PKI and certificates
A Certificate Authority (CA) signs X.509 digital certificates that bind a public key to a domain or person. Browsers trust a set of root CAs.
Classic ciphers (for practice)
Caesar cipher: shift each letter by k (k = 3: A→D). Substitution and transposition ciphers. Brute force tries every key – a larger key space (e.g. AES-256) makes it infeasible.
Asymmetric encryption – simply explained (Simply Explained)
This lesson ends with a quiz of 55 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: 10.1 Security Basics, Threats and Malware · Next: 10.3 Network and Web Application Security