Prepping for post-quantum: a beginner’s guide to lattice cryptography
Mar 21, 2025Christopher Patton, Peter Schwabe

Summary
This post introduces lattice cryptography as a foundational element for post-quantum (PQ) cryptography, explaining its application in key exchange protocols like ML-KEM. It details the mathematical concepts of matrices, modular arithmetic, matrix transpose, matrix multiplication, and matrix addition as they apply to lattice-based cryptography. The post provides a simplified Python implementation using NumPy to illustrate how these operations can be used to establish a shared secret, analogous to Diffie-Hellman key exchange, while highlighting the significantly larger communication overhead of lattice-based schemes compared to current elliptic-curve cryptography.
More from the Random Number Generation for Security trail
- Support for modern cryptographic algorithms in Workers
- Using AI to chart a course for our post-quantum migration
- Post-quantum authentication to origins is now supported
- Why we cannot wait for better post-quantum signature algorithms
- The White House's post-quantum executive order is an important milestone. It’s time to get to work