Computer Network & Network Security System β Network Security, NEC licence examination syllabus (Nepal Engineering Council).
Principles of Cryptography: the two-key idea that changed everything
For most of history, secure communication needed a shared secret. One idea broke that requirement completely.
π Symmetric vs Asymmetric Cryptography
symmetric keys = n(nβ1)/2 Β· asymmetric key pairs = n With n = 20, sym = 190, asym = 20.
At 500 parties: 124,750 shared secrets against 500 key pairs. That gap is the whole reason public-key cryptography exists.
SymmetricSAME key encrypts and decrypts. Fast, but both parties must somehow securely share that one key beforehand β a real logistical problem.
AsymmetricTwo DIFFERENT keys β a public key (share with anyone) and a private key (keep absolutely secret). Solves the key-sharing problem entirely, at the cost of being much slower.
π Substitution vs Transposition Ciphers
SubstitutionReplace each letter/symbol with a different one (e.g. Caesar cipher β shift every letter by a fixed amount).
TranspositionKeep the same letters, but rearrange their ORDER.
Block ciphers encrypt fixed-size chunks of data at a time. DES (Data Encryption Standard) used a 56-bit key β now considered too weak/breakable by modern hardware. AES (Advanced Encryption Standard) replaced it with 128/192/256-bit keys, and is the standard almost everything uses today.
π‘ One-liner: "Why is asymmetric cryptography slower than symmetric?" β The underlying math (large prime number operations) is far more computationally expensive than symmetric algorithms' simpler bit operations β which is exactly why real systems (like HTTPS) use asymmetric crypto only briefly to safely exchange a symmetric key, then switch to fast symmetric encryption for the actual data.
How bad the key-sharing problem really is
"Both parties must securely share that one key beforehand" sounds like an inconvenience. Count the keys and it becomes impossible.
Every PAIR needs its own shared secret, so n parties need
n(nβ1)/2 keys:
10 parties 45 keys
100 parties 4,950 keys
1,000 parties 499,500 keys
With asymmetric cryptography each party needs ONE key pair:
1,000 parties 1,000 key pairs
The symmetric count grows quadratically. Adding the thousandth participant means agreeing 999 new secrets, each of which must be exchanged over some channel that is already secure β and if such a channel existed, you would not need the encryption. Asymmetric cryptography needs one more key pair, and the public half can be published openly.
π‘ That is the honest answer to "why do we need public-key cryptography when symmetric is faster?" β not that symmetric is insecure, but that it cannot be deployed between parties who have never met. Which is precisely the situation every website visit is.
Why real systems use both
Asymmetric cryptography is typically hundreds of times slower and can only encrypt data smaller than its modulus. So it is used for exactly one thing: agreeing a symmetric key.
1. Asymmetric β establish a shared session key securely
2. Symmetric β encrypt the actual data with that key, fast
π‘ Every practical system does this, under different names: SSL/TLS calls it the handshake and the record protocol, PGP calls it the session key. Recognising the pattern means three topics in this chapter are one idea β use the slow method to bootstrap the fast one.
What "secure" rests on
π Kerckhoffs's principle
The ruleA cryptosystem must remain secure even if everything about it except the key is public knowledge.
WhyAlgorithms leak β through reverse engineering, disclosure or theft. A key can be changed; a secret algorithm, once known, cannot be un-known.
π‘ This is why AES and RSA are fully published and still secure, and why "security through obscurity" is a criticism rather than a strategy. A system whose safety depends on nobody knowing how it works has no measurable security at all β you cannot analyse what you cannot see.
Syllabus points
Symmetric vs asymmetric key cryptography
Substitution & transposition ciphers
Block ciphers: DES, AES (overview)
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.