Quantum Computing – Harvest Now Decrypt Later Threat
- Qubit: α|0⟩+β|1⟩ where |α|²+|β|²=1. Measurement collapses to |0⟩ (prob |α|²) or |1⟩ (prob |β|²).
- Quantum parallelism: n qubits represent all 2^n states simultaneously — but you cannot extract all answers without clever interference.
- Interference is the mechanism of quantum speedup — constructive for correct answers, destructive for wrong ones.
- Quantum computing is not a faster classical computer — it's a different model exploiting superposition and interference.
- A qubit: α|0⟩ + β|1⟩ where |α|²+|β|²=1. Measurement collapses to one classical bit.
- n qubits represent all 2^n basis states simultaneously — quantum parallelism.
- Entanglement: qubits correlate so measuring one determines the other instantly.
- Quantum speedup: exponential for factoring (Shor), quadratic for search (Grover). No speedup for most everyday computation.
- Cryptographic threat: Shor breaks RSA/ECC. NIST post-quantum standards (Kyber, Dilithium) are being deployed now.
Post-Quantum Risk Assessment Commands
Need to inventory RSA/ECC keys in your infrastructure
openssl x509 -in cert.pem -text -noout | grep 'Public-Key'ssh-keyscan -t rsa example.com 2>/dev/null | ssh-keygen -l -f -Need to know if your TLS library supports PQC
openssl version -a | grep -i 'compiler'echo 'GET /' | openssl s_client -connect example.com:443 -tls1_3 2>/dev/null | grep -i 'kyber\|mlkem'Need to estimate your organisation's quantum risk exposure
echo "Current year + data retention period"echo "If >2035, high risk. If 2030-2035, medium risk. If <2030, low risk."Production Incident
Production Debug GuidePractical steps for assessing and migrating your cryptographic systems before quantum becomes practical
Quantum computing is not a faster classical computer. It is a fundamentally different computational model that exploits quantum mechanical phenomena — superposition, entanglement, and interference — to solve specific problem classes that are exponentially hard for classical computers.
The developer's mental model: a quantum computer with n qubits represents a superposition of all 2^n possible n-bit states simultaneously. A quantum algorithm manipulates this superposition to amplify the probability of the correct answer. Measurement collapses the superposition to a single outcome. The art of quantum algorithm design is arranging the interference so the correct answer has high probability.
As of 2026, quantum computers with 100-1000 physical qubits exist but are noisy (NISQ era). Fault-tolerant quantum computers that can run Shor's algorithm to break RSA-2048 likely require millions of physical qubits and remain years away. But the cryptographic threat is taken seriously: post-quantum cryptography standardisation (NIST 2024) is happening now.
Qubits and Quantum Gates
A qubit state is |ψ⟩ = α|0⟩ + β|1⟩ where |α|² + |β|² = 1. α and β are probability amplitudes. Upon measurement, the qubit collapses to |0⟩ with probability |α|² or |1⟩ with probability |β|².
- Hadamard (H): |0⟩ → (|0⟩+|1⟩)/√2 — creates equal superposition
- Pauli-X: |0⟩ → |1⟩, |1⟩ → |0⟩ — quantum NOT gate
- CNOT: Flips target qubit if control qubit is |1⟩ — creates entanglement
- Phase gates (T, S): Add phase to |1⟩ component — essential for interference
A subtle but critical point: the phase of a qubit is relative, not absolute. The state |ψ⟩ and e^{iθ}|ψ⟩ produce the same measurement probabilities but interfere differently with other qubits. This is why interference is the engine of quantum speedup.
import numpy as np # Simple qubit state simulation ket0 = np.array([1, 0], dtype=complex) # |0⟩ ket1 = np.array([0, 1], dtype=complex) # |1⟩ # Hadamard gate H = np.array([[1,1],[1,-1]], dtype=complex) / np.sqrt(2) # Apply H to |0⟩ — creates superposition psi = H @ ket0 print(f'H|0⟩ = {psi}') # [0.707, 0.707] print(f'P(|0⟩) = {abs(psi[0])**2:.3f}') # 0.5 print(f'P(|1⟩) = {abs(psi[1])**2:.3f}') # 0.5 # Use Qiskit for real quantum circuits try: from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector qc = QuantumCircuit(2) qc.h(0) # Hadamard on qubit 0 qc.cx(0, 1) # CNOT: creates Bell state (entanglement) sv = Statevector(qc) print('Bell state:', sv) except ImportError: print('pip install qiskit for full quantum simulation')
P(|0⟩) = 0.500
P(|1⟩) = 0.500
(Qiskit not installed — bell state requires pip install qiskit)
- |0⟩ + |1⟩ and |0⟩ - |1⟩ both measure 50/50. But they interfere differently.
- (|0⟩+|1⟩)/√2 = H|0⟩. (|0⟩-|1⟩)/√2 = H|1⟩.
- Apply H again to the first: you get back |0⟩. Apply H to the second: you get |1⟩.
- Phase is how quantum algorithms 'mark' correct answers before interference amplifies them.
Superposition, Entanglement, and Interference — The Three Engines
Superposition: A qubit can be in both |0⟩ and |1⟩ states simultaneously. n qubits can represent all 2^n states simultaneously — this is quantum parallelism. But careful: you cannot read that whole superposition out. Measurement collapses it to a single state. The challenge is to manipulate the superposition so that the probability of measuring the correct answer is high.
Entanglement: Two qubits can be correlated such that measuring one instantly determines the other, regardless of distance. A Bell state (|00⟩+|11⟩)/√2 collapses to either both-0 or both-1 with equal probability — never one-0-one-1. Entanglement is what makes quantum cryptography (BB84 protocol) possible and enables superdense coding.
Interference: Quantum states have phases. Quantum algorithms are designed so that probability amplitudes of wrong answers cancel (destructive interference) while the correct answer's amplitude grows (constructive interference). This is not just 'trying all answers at once' — it's arranging the computation so the right answer emerges.
Quantum Advantage — When Quantum Actually Helps
Quantum computers are not universally faster. They provide speedup for specific problem classes:
Exponential speedup: - Shor's algorithm — factoring integers (breaks RSA, ECC). - Quantum simulation — simulating quantum chemistry (materials science, drug discovery). - Discrete logarithm problems.
Quadratic speedup: - Grover's search — unstructured search O(√N) vs classical O(N). - Quantum counting — counting solutions to a search problem.
No known speedup (classical remains optimal or near-optimal): - Sorting, most string processing, graph traversal, linear algebra for classical data. - Neural network training (except for specific quantum ML models on quantum data). - Everyday computation — your web server, database, or game engine will never be replaced by a quantum computer.
The most important practical takeaway: quantum speedup is not a function of data size but of problem structure. Shor's algorithm exploits periodicity. Grover's algorithm uses amplitude amplification. Without these structures, quantum offers nothing.
Post-Quantum Cryptography — What Developers Need to Do Now
Shor's algorithm breaks RSA and ECC — the foundations of modern TLS, digital signatures, and code signing. A sufficiently powerful fault-tolerant quantum computer renders today's public-key infrastructure obsolete overnight.
- CRYSTALS-Kyber (ML-KEM): Key encapsulation mechanism (key exchange replacement).
- CRYSTALS-Dilithium (ML-DSA): Digital signatures (primary signature algorithm).
- FALCON (FN-DSA): Digital signature alternative (smaller signatures, more complex implementation).
- SPHINCS+ (SLH-DSA): Stateless hash-based signatures (no mathematical foundation to break, but larger signatures).
The migration strategy is hybrid cryptography: use both classical and post-quantum algorithms in parallel. A TLS handshake that negotiates both ECDHE and Kyber is secure against both today's attackers and tomorrow's quantum computers. Clients that don't support post-quantum algorithms fall back to classical.
Harvest now, decrypt later is a real threat: an adversary can store encrypted traffic today and decrypt it years later when quantum computers become available. If your data needs to remain confidential for 10+ years, you should be using hybrid encryption now.
The timeline: NIST finalised standards in 2024. Crypto libraries are integrating (BoringSSL, AWS-LC, OpenSSL 3.x with providers). Cloud providers offer PQC KEM options for internal encryption. Major browsers and CDNs are experimenting with hybrid TLS. Start planning your migration now — not when the first RSA break is announced.
#!/bin/bash # ============================================================ # Quick post-quantum readiness assessment script # Run this to check if your environment supports PQC # ============================================================ echo "=== OpenSSL PQC Support ===" # OpenSSL 3.x with oqsprovider if openssl version | grep -q '3\.'; then echo "OpenSSL 3.x detected. Check for oqsprovider:" openssl list -providers 2>/dev/null | grep -i oqs && echo "OQS provider installed" || echo "OQS provider NOT installed" else echo "OpenSSL version < 3.0. Upgrade for PQC support" fi echo -e "\n=== BoringSSL / AWS-LC PQC Support ===" grep -q "KYBER" /usr/local/include/openssl/ssl.h 2>/dev/null && echo "Kyber support in BoringSSL" || echo "Check BoringSSL version" echo -e "\n=== Code Signing Algorithm ===" # Check signature algorithm of a binary if command -v codesign &>/dev/null; then codesign -d --verbose=4 "$(which bash)" 2>&1 | grep -i 'signature' | head -1 fi echo -e "\n=== SSH Host Key Algorithms ===" ssh -Q key | grep -E "rsa|ecdsa|ed25519" | head -5 echo -e "\n=== TLS Cipher Suites (hybrid PQC check) ===" # This requires a test endpoint openssl s_client -connect google.com:443 -tls1_3 2>/dev/null | grep -i 'cipher' | head -1 echo -e "\n=== Recommendation ===" echo "If you see RSA or ECDSA keys (especially for long-lived certificates), plan migration to ML-DSA (Dilithium)." echo "Enable hybrid key exchange (ML-KEM + ECDH) in dev environments now."
OpenSSL 3.x detected. Check for oqsprovider:
OQS provider NOT installed
=== BoringSSL / AWS-LC PQC Support ===
Check BoringSSL version
=== Code Signing Algorithm ===
Signature: RSA
=== SSH Host Key Algorithms ===
ssh-rsa
rsa-sha2-512
rsa-sha2-256
ecdsa-sha2-nistp256
ssh-ed25519
=== TLS Cipher Suites (hybrid PQC check) ===
Cipher : TLS_AES_256_GCM_SHA384
=== Recommendation ===
If you see RSA or ECDSA keys (especially for long-lived certificates), plan migration to ML-DSA (Dilithium).
Enable hybrid key exchange (ML-KEM + ECDH) in dev environments now.
| Problem Class | Classical Best Complexity | Quantum Best Complexity | Speedup Type | Real-World Example |
|---|---|---|---|---|
| Integer factoring | O(exp( (64/9)^{1/3} (log n)^{1/3} (log log n)^{2/3} )) | O((log n)^3) | Exponential | Breaking RSA encryption |
| Unstructured search | O(N) | O(√N) | Quadratic | Searching an unsorted database |
| Quantum simulation | O(exp(N)) | O(poly(N)) | Exponential | Drug discovery, materials science |
| Discrete logarithm | Sub-exponential | O((log n)^3) | Exponential | Breaking ECC, some blockchains |
| Sorting numbers | O(N log N) | No known speedup | None | Database ORDER BY |
| Graph shortest path (Dijkstra) | O(E + V log V) | No known speedup | None | GPS navigation routing |
| Classical ML training | O(N) - O(N^3) depending on method | No proven advantage for classical data | None | Fraud detection, recommendation systems |
🎯 Key Takeaways
- Qubit: α|0⟩+β|1⟩ where |α|²+|β|²=1. Measurement collapses to |0⟩ (prob |α|²) or |1⟩ (prob |β|²).
- Quantum parallelism: n qubits represent all 2^n states simultaneously — but you cannot extract all answers without clever interference.
- Interference is the mechanism of quantum speedup — constructive for correct answers, destructive for wrong ones.
- Quantum advantages: exponential speedup for factoring (Shor), quadratic for search (Grover). No speedup for general computing.
- Cryptographic threat: Shor breaks RSA/ECC on fault-tolerant QC. Post-quantum standards (CRYSTALS-Kyber, Dilithium) are deployed now.
- Hybrid cryptography (classical + PQC) is the safe migration path — do not replace classical yet, augment it.
- NISQ devices are noisy; fault-tolerant QC with millions of physical qubits is years away. But long-lived data migration must start now.
⚠ Common Mistakes to Avoid
Interview Questions on This Topic
- QWhat is superposition and how many states can n qubits represent simultaneously?JuniorReveal
- QWhy is a quantum computer not simply a faster classical computer?Mid-levelReveal
- QWhich quantum algorithm threatens current public-key cryptography and why?SeniorReveal
- QWhat is entanglement and why is it important for quantum computing?Mid-levelReveal
- QWhat is 'harvest now, decrypt later' and why should developers care today?SeniorReveal
Frequently Asked Questions
Can I run quantum algorithms today?
Yes — IBM Quantum, Google Quantum AI, and Amazon Braket provide cloud access to real quantum hardware. Qiskit (IBM), Cirq (Google), and PennyLane (Xanadu) are the main Python frameworks. Current noisy hardware (NISQ) supports small demonstrations for research and education. Fault-tolerant quantum computation at useful scale (e.g., breaking RSA) remains future work, likely 2030+.
Will quantum computers replace classical computers?
No — quantum computers are accelerators for specific problem classes, not general-purpose replacements. Your laptop, cloud server, and phone will remain classical. Quantum computers will be used as co-processors for tasks like factoring, optimisation, or materials simulation. Most everyday computing (web browsing, databases, gaming) will never run on quantum hardware.
How many qubits are needed to break RSA?
Breaking RSA-2048 requires ~4000-5000 logical qubits (error-corrected). Each logical qubit requires thousands of physical qubits (e.g., surface code with ~1,000 physical qubits per logical qubit). So millions of physical qubits are needed. Current state-of-the-art: 100-1000 noisy physical qubits. Fault-tolerant scaling remains the central engineering challenge.
What is the difference between physical and logical qubits?
Physical qubits are the real hardware qubits — they are noisy, have limited coherence times, and decohere. Logical qubits are constructed from many physical qubits using quantum error correction (QEC), such as the surface code. A logical qubit is 'fault-tolerant': it preserves quantum information longer than the physical qubits' coherence time. The ratio of physical to logical qubits is high (1000+ per logical qubit). When people say RSA requires 4000 qubits, they mean logical qubits — millions of physical qubits are needed.
What is quantum volume?
Quantum volume is a hardware-agnostic metric that combines qubit count, error rates, connectivity, and coherence time into a single number. A quantum volume of 2^n means the device can run a circuit of depth n on n qubits with acceptable success probability. Two devices with the same qubit count can have very different quantum volumes. It's a better benchmark than raw qubit count for NISQ-era devices.
Should I start using PQC in my applications today?
For new systems that handle long-lived confidential data (healthcare records, financial archives, government data), yes — implement hybrid PQC now. Use NIST-standardised algorithms: CRYSTALS-Kyber (ML-KEM) for key exchange, CRYSTALS-Dilithium (ML-DSA) for signatures. Enable hybrid mode (classical + PQC) so compatibility isn't broken. For short-lived session data (e.g., temporary API tokens), classical crypto remains acceptable, but gaining operational experience with PQC is valuable.
Developer and founder of TheCodeForge. I built this site because I was tired of tutorials that explain what to type without explaining why it works. Every article here is written to make concepts actually click.