Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Planning a post-quantum migration

After this lesson: I can build a cryptographic inventory and put a post-quantum migration in order of urgency.

65 min lesson6 commandsPost-quantum cryptography lab: ML-KEM, ML-DSA, hybrid TLS and post-quantum SSH with OpenSSL 3.5 and OpenSSH 10

What a post-quantum migration is

A post-quantum migration is the project of finding every place an organisation uses public-key cryptography and moving it to post-quantum methods. It takes years, so planning it well matters more than any one command.

Picture a college with a VPN, a website, door badges and backups. Each uses cryptography, often in places nobody has written down.

By the end of this lesson

Note

I can build a cryptographic inventory and put a post-quantum migration in order of urgency.

Key words

WordWhat it means
Cryptographic inventorya list of where and how cryptography is used
Crypto agilitybeing able to change an algorithm by changing a setting
Migrationmoving systems from old methods to new ones
Urgencyhow soon a system must move
Middleboxa firewall or proxy that inspects traffic on the way

The cells students fill in are left blank in this preview.

Start with a cryptographic inventory

You cannot move what you have not found. An inventory lists each system with its key exchange, signatures and certificates. It also records the shelf life of its data, its owner and whether it can be updated.

Look in configuration files, certificate stores, code libraries and suppliers' answers. Embedded devices such as door badges and meters are often the hardest to find and to change.

Worked example: part of a college's inventory

SystemKey exchangeSignatureShelf lifeCan it be updated?
Staff VPNECDHRSA-204810 yearsYes, by the supplier
Public websiteX25519MLKEM768ECDSA P-256NoneYes, a setting
Student records linkX25519RSA-204830 yearsYes, a setting
Door badgesRSARSA-20481 yearNo, new hardware

The cells students fill in are left blank in this preview.

Put the work in order

First, key exchange for data with a long shelf life, because recordings are being made now. Second, anything a setting can fix, such as TLS groups and SSH key exchanges. Third, certificate authorities and signatures, which must be safe before quantum computers arrive.

Last, hardware that cannot be updated. It needs replacing, so it goes in the budget early even if the work comes late.

Crypto agility makes the next change cheap

A system is crypto agile when its algorithms are a setting, not code. The lab's TLS server chooses its groups with one option, and OpenSSH chooses its key exchange with one line.

Agility matters because this will not be the last change. A flaw found in one algorithm should mean editing a list, not rewriting a program.

What signed the TLS root?

Command
docker exec pq sh -c "openssl x509 -in /keys/tls-ca.crt -noout -text | grep -E 'Subject:|Signature Algorithm'"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The TLS server's group and signature

Command
docker exec pq sh -c "openssl s_client -connect tls:4433 -servername tls -CAfile /keys/tls-ca.crt -brief 2>&1 | grep -E 'group|Signature type'"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The SSH server's key exchange and host key

Command
docker exec pq sh -c "ssh -v sshd true 2>&1 | grep -E 'kex: algorithm|host key algorithm'"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The old-style SSH server

Command
docker exec pq sh -c "ssh -v legacy true 2>&1 | grep -E 'kex: algorithm|host key algorithm'"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Your own SSH key's type

Command
docker exec pq sh -c "ssh-keygen -l -f /keys/client.pub | grep -o ED25519"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The TLS groups are one setting

Command
docker exec tls sh -c "xargs -0 < /proc/1/cmdline"

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

The lab's own inventory

WhereWhat the Run printedVerdict
TLS root certificateSignature Algorithm: ML-DSA-65, Subject: CN=Lab Root CAPost-quantum
TLS serverSignature type: mldsa65, Negotiated TLS1.3 group: X25519MLKEM768Post-quantum
SSH on 2222kex: algorithm: mlkem768x25519-sha256, host key algorithm: ssh-ed25519Key exchange done, host key classical
SSH on 2200kex: algorithm: curve25519-sha256, host key algorithm: ssh-ed25519Urgent if its data lasts
Your SSH keyED25519Classical signature, checked live
TLS server settingsopenssl s_server ... -groups X25519MLKEM768:X25519:MLKEM768 -www -quietAgile: one option

The cells students fill in are left blank in this preview.

The cost is bytes, not time

ML-KEM and ML-DSA are fast: each step takes well under a millisecond on a laptop. The cost is size. A hybrid ClientHello no longer fits in one network packet, and some old middleboxes dropped such handshakes.

A chain of ML-DSA certificates adds kilobytes to every new TLS connection. Test on your own network, and roll out with the classical method still allowed as a fallback.

A common mistake

Warning

Many people think migration means swapping one algorithm for another, once. It means finding every use, changing what a setting can change, replacing what it cannot, and keeping things agile. Start with the inventory, not the algorithm.

What this lab leaves out

Note

WireGuard VPNs can gain a post-quantum key with Rosenpass, which runs beside WireGuard. It needs a kernel module and network rights a lab does not have, so it is not here. Hardware security modules and smart cards are left out too.

About this lab and its source: Post-quantum cryptography lab: ML-KEM, ML-DSA, hybrid TLS and post-quantum SSH with OpenSSL 3.5 and OpenSSH 10

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.