Post-quantum cryptography lab: ML-KEM, ML-DSA, hybrid TLS and post-quantum SSH with OpenSSL 3.5 and OpenSSH 10
This lab gives each student the real post-quantum tools: OpenSSL 3.5, the first version to include ML-KEM and ML-DSA, and OpenSSH 10, which uses a post-quantum key exchange by default. Beside the student’s workstation run a TLS 1.3 server that offers the hybrid group X25519MLKEM768 and an SSH server, so they can see which key exchange a real connection agrees. It goes with the module Post-quantum cryptography in practice.
It is not an attack lab. Every copy has no route to the internet and none to any other student, and it has no web page, so everything is typed in the terminal beside it. Every key, certificate and host key is made when the lab starts, so no two copies share a secret.
What students learn
Why traffic recorded today is at risk from a future quantum computer, and how a key encapsulation mechanism works: they make an ML-KEM-768 key pair with openssl genpkey, encapsulate and decapsulate with openssl pkeyutl, and measure the 1088-byte ciphertext and 32-byte secret. They read the group a TLS 1.3 server agreed with openssl s_client, X25519MLKEM768 by default and X25519 when the client asks for it, sign with ML-DSA and run a small certificate authority, and read the SSH key exchange from ssh -v: mlkem768x25519-sha256 on a current server and curve25519-sha256 on an old-style one. It suits a security, networks or applied cryptography course.
Run it in your browser
The lab starts three services and waits until they answer: pq, the student’s workstation with a folder /lab, tls, a TLS server on port 4433, and sshd, an SSH server on port 2222 and an old-style one on port 2200. The terminal reaches the workstation with docker exec pq. The workstation’s SSH settings already know both servers, as sshd and legacy, and its key is the only one they let in.
- Open the Container page. Open Build on the bar and choose Run a container. Anybody may open it, and the Git lab and the SQL lab start with no account. Every other lab needs a free account: create one, sign in, then press Start.
- Find the lab. The Sample labs card lists every sample. Find Post-quantum cryptography (OpenSSL 3.5 and OpenSSH 10).
- Press Start. Start runs it as it is, in one press. Edit the file first opens the compose file so you can change it before you start.
- Open it. On the lab’s page, press Open terminal. There is no link under In your browser because the lab has no web page. Type docker exec pq openssl version and the terminal answers OpenSSL 3.5.7. Then docker exec pq openssl genpkey -algorithm ML-KEM-768 -out kem.pem makes a post-quantum key pair.
What to ask students to hand in
A short report on their own copy: the TLS group agreed for three client group lists they chose, the public key and ciphertext sizes of ML-KEM-512 and ML-KEM-1024 from their own keys, a chain of three ML-DSA certificates (a root, an intermediate and a server) that openssl verify accepts, and the SSH key exchange agreed when they force sntrup761x25519-sha512. Then one sentence on which of those connections a recording made today could be broken by a future quantum computer. A good answer names the classical ones, X25519 on its own above all.
A basic lesson on this lab
Post-Quantum Crypto Basics is a small lesson worked in this lab. In it a student checks the OpenSSL version, makes an ML-KEM-768 key pair, wraps a secret with the public key and unwraps it with the private key, reads the hybrid group the TLS server agrees and the classical one it agrees when only X25519 is offered, and reads the key exchange on the current and the old-style SSH server.
Free personal accounts have it in the Basics module, which is on Home, every college can copy it from the Library’s Basics folder, and a new college opens with it in a module called Security Labs (Sample). It is deliberately small: it shows a teacher what a lesson worked in a lab is, and the lab does the rest. Copy it into a module of your own to change it.
The code on GitHub
The compose file has no Dockerfile. It runs two stock public images, pinned: Debian 13’s buildpack-deps image, pinned by digest, for the workstation and the TLS server, with Debian’s own OpenSSL 3.5 and OpenSSH 10.0 client, and the LinuxServer.io openssh-server image, version 10.3, for the SSH server. The SSH server runs as an unprivileged account without the image’s own start-up scripts. Neither image is distributed by us. Memory is 128 MB for each of the first two and 64 MB for the SSH server. WireGuard with Rosenpass is not included, because it needs a kernel module and network rights a lab does not have.
Set it as work
Say in the task what to hand in.
- Make the lab. In your module add a task and choose the Container lab card, then In a GitHub repository. Give https://github.com/mitsurutech/lab-pq-lab with the branch main. The compose file is the default, compose.yaml. Fork the repository first if you want to change it.
- Publish and try it. Publish pins the commit you were shown, so a later change in the repository does not alter a lab you have already set. Start your own copy first.
- Hand it out. Assign it like any task, with a due date if you want one, and say in the task what to do and what to hand in.
- Mark what is handed in. Open a student’s copy and the work they handed in, mark it, and send it back with a reason if it needs more.
Try this lab, and what it costs
A free personal account can work through the basic lessons in this lab, with enough free credit each month to follow most lessons and no card. For a class, a school or college has its first 365 days free for up to 50 students, then pays per student a year, with every lab included and staff free.
Questions people ask
- Is this real post-quantum cryptography or a simulation?
- Real. ML-KEM and ML-DSA are the standard algorithms, run by OpenSSL 3.5, and the TLS and SSH servers really agree X25519MLKEM768 and mlkem768x25519-sha256. What is not real is the setting: keys are in files, there is no hardware security module, and nothing faces the internet.
- Why does the lab have an old-style SSH server?
- To show a fallback. The server on port 2200 offers only classical key exchange, so a current client agrees curve25519-sha256 there with no warning. Seeing that is the point of reading the key exchange rather than trusting the client.
- Why are the keys different in every copy?
- Every key, certificate and SSH host key is made when the lab starts, so no secret is in the public compose file and no two students share one. The lessons quote only what stays the same, such as sizes, algorithm names and the group agreed.
- Does it include WireGuard with Rosenpass?
- No. Rosenpass adds a post-quantum key to WireGuard, but WireGuard needs a kernel module and rights to change network interfaces, which a lab container does not have. The module names it in its last lesson.