LOGBOOK

HELP

1 / 29
Other keys: showSpace: good1-4: rate0: skip5: flag

Question

In a peer-to-peer network with symmetric keys only, how does the key count grow with the number of users n, and what is the operational problem?

Answer

Each pair needs its own shared key, so the total is n·(n-1)/2 — quadratic in n. Worse, every new user has to securely exchange a key with every existing user before they can talk.

Symmetric key count n(n-1)/2 (quadratic) versus asymmetric n (linear) as the number of users grows

* Symmetric keys grow quadratically as n·(n−1)/2 — 4,950 for 100 users — while public-key grows linearly as n. *

Users n Symmetric keys needed
4 6
10 45
100 4,950
1,000 499,500

Two compounding problems:

  1. Storage: every user must store n−1 keys. Add a million users and each device holds nearly a million keys.
  2. Distribution: how do you securely deliver each fresh pairwise key in the first place? A secure channel doesn't exist yet — that's the whole point of crypto.

The fix — public-key (asymmetric) cryptography. Each user has one keypair (public + private). Anyone who wants to talk to Alice uses Alice's public key; only she can decrypt. Number of keys grows linearly with n, not quadratically — and the public key can be shared on a billboard.

Tip: Modern systems are hybrid: asymmetric crypto only bootstraps a per-session symmetric key, then the actual data is encrypted symmetrically (1000× faster). TLS, SSH, Signal all work this way.

Go deeper:

Illustration
CC BY 4.0 · Wikimedia Commons
or press any other key

Question

What is the core principle behind public-key (asymmetric) cryptography?

Answer

Encryption is an "easy" mathematical function whose inverse (decryption without the secret) is presumed to be hard. Anyone can encrypt with the public key; only the holder of the private key can decrypt.

A one-way trapdoor: multiplying 31 by 67 to get 2077 is easy, but factoring 2077 back into its primes is hard

* The trapdoor at the heart of public-key crypto: multiplying 31×67 is trivial; factoring 2077 back into its primes is hard. *

The textbook analogy is multiplication vs. factorisation:

Direction Example Difficulty
Multiplication 31 × 67 = 2077 Trivial — seconds with pen and paper
Factorisation 2077 = ? × ? Hard — for huge numbers, computationally infeasible

This one-way / trapdoor function is the foundation of every PK scheme. Encryption uses the public-key transformation; decryption needs the private "trapdoor" that makes the inverse easy.

Important caveats:

  • "Hard" means we don't know an efficient algorithm. None of these are proven hard — RSA's security depends on factoring being hard, but mathematicians haven't ruled out a fast factoring algorithm. A working quantum computer running Shor's algorithm would break RSA in polynomial time.
  • The scheme is asymmetric because the encrypt direction is easy for everyone, but decrypt is easy only with the private key.

Tip: The whole asymmetric crypto field hinges on "P ≠ NP and these specific problems are hard." If P = NP turned out true, factoring (and RSA) would fall — and the Clay $1M prize, plus a lot of internet security, would be the casualty.

Go deeper:

The idea of trapdoor function. A trapdoor function f with its trapdoor t can be generated by an algorithm Gen. f can be efficiently computed, i.e., in probabilistic polynomial time. However, the computation of the inverse of f is generally hard, unless the trapdoor t is given.[1]
The idea of trapdoor function. A trapdoor function f with its trapdoor t can be generated by an algorithm Gen. f can be efficiently computed, i.e., in probabilistic polynomial time. However, the computation of the inverse of f is generally hard, unless the trapdoor t is given.[1]
IkamusumeFan · CC BY-SA 4.0 · Wikimedia Commons
or press any other key