Chapter 21: Cryptography & Network Information Theory

Part VII: Modern Applications

The One-Time Pad & Perfect Secrecy

Claude Shannon (1949) proved that the one-time pad (OTP) achieves perfect secrecy: the ciphertext reveals absolutely nothing about the plaintext.

\( C = M \oplus K \)

XOR the message \(M\) with a random key \(K\) of equal length

Perfect secrecy condition: \(H(M|C) = H(M)\) — the posterior distribution of the message given the ciphertext equals the prior. Equivalently, \(I(M;C) = 0\): ciphertext and message are statistically independent.

Shannon's theorem: perfect secrecy requires \(H(K) \geq H(M)\) — the key must have at least as much entropy as the message. The OTP achieves this with equality. The key must be truly random, never reused, and kept secret.

Shannon Secrecy Capacity

Wyner (1975) introduced the wiretap channel: Alice communicates to Bob over a channel\(p(y|x)\), while an eavesdropper Eve observes a degraded version\(p(z|x)\). The secrecy capacity is:

\( C_s = \max_{p(x)} \bigl[I(X;Y) - I(X;Z)\bigr] = \max(0, C_m - C_e) \)

For Gaussian channels: if Bob's SNR is higher than Eve's, positive secrecy rate is achievable without a shared secret key — using only the channel's physical properties. This is the foundation of physical-layer security.

Computational Security & Public-Key Cryptography

Real-world cryptography (RSA, Diffie-Hellman, AES) does not achieve perfect secrecy — it relies on computational hardness assumptions. The ciphertext does contain information about the message, but extracting it requires solving problems believed to be computationally intractable (integer factorization, discrete logarithm).

RSA Security

Based on hardness of factoring \(n = pq\). Secure if factoring is hard. Key size 2048 bits provides ~112 bits of security.

Quantum Threat

Shor's algorithm (1994) factors in polynomial time on a quantum computer. Post-quantum cryptography (lattice-based) resists quantum attacks.

Network Coding & Slepian-Wolf

Classical networking routes packets without modification. Network coding(Ahlswede et al., 2000) allows intermediate nodes to linearly combine packets, achieving the multicast capacity \(\min_{S \text{-cuts}} \text{capacity}\) — impossible with pure routing.

Slepian-Wolf theorem (1973): Two correlated sources \(X, Y\) compressed independently can be jointly decoded at rates:

\( R_X \geq H(X|Y), \quad R_Y \geq H(Y|X), \quad R_X + R_Y \geq H(X,Y) \)

This is remarkable: even without coordination between encoders, the joint compression rate \(H(X,Y)\) is achievable — as if both encoders could see each other's data. Applications include sensor networks and distributed video coding.

Python: OTP, Secrecy Capacity & Slepian-Wolf

Demonstrate that OTP produces uniform ciphertext regardless of plaintext entropy, plot Shannon secrecy capacity vs SNR, and visualize the Slepian-Wolf achievable rate region.

Python
script.py211 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server