Skip to content

Commit 27b042c

Browse files
authored
Merge pull request #51517 from graz-dev/mirror-post-quantum-cryptography-blog-post
Mirror post quantum cryptography blog
2 parents 868409f + b89aad5 commit 27b042c

File tree

1 file changed

+216
-0
lines changed

1 file changed

+216
-0
lines changed
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
layout: blog
3+
title: "Post-Quantum Cryptography in Kubernetes"
4+
slug: pqc-in-k8s
5+
date: XXXX
6+
canonicalUrl: XXXX
7+
author: "Fabian Kammel (ControlPlane)"
8+
draft: true
9+
---
10+
11+
The world of cryptography is on the cusp of a major shift with the advent of
12+
quantum computing. While powerful quantum computers are still largely
13+
theoretical for many applications, their potential to break current
14+
cryptographic standards is a serious concern, especially for long-lived
15+
systems. This is where _Post-Quantum Cryptography_ (PQC) comes in. In this
16+
article, I\'ll dive into what PQC means for TLS and, more specifically, for the
17+
Kubernetes ecosystem. I'll explain what the (suprising) state of PQC in
18+
Kubernetes is and what the implications are for current and future clusters.
19+
20+
## What is Post-Quantum Cryptography
21+
22+
Post-Quantum Cryptography refers to cryptographic algorithms that are thought to
23+
be secure against attacks by both classical and quantum computers. The primary
24+
concern is that quantum computers, using algorithms like [Shor\'s Algorithm],
25+
could efficiently break widely used public-key cryptosystems such as RSA and
26+
Elliptic Curve Cryptography (ECC), which underpin much of today\'s secure
27+
communication, including TLS. The industry is actively working on standardizing
28+
and adopting PQC algorithms. One of the first to be standardized by [NIST] is
29+
the Module-Lattice Key Encapsulation Mechanism (`ML-KEM`), formerly known as
30+
Kyber, and now standardized as [FIPS\-203] (PDF download).
31+
32+
It is difficult to predict when quantum computers will be able to break
33+
classical algorithms. However, it is clear that we need to start migrating to
34+
PQC algorithms now, as the next section shows. To get a feeling for the
35+
predicted timeline we can look at a [NIST report] covering the transition to
36+
post-quantum cryptography standards. It declares that system with classical
37+
crypto should be deprecated after 2030 and disallowed after 2035.
38+
39+
## Key exchange vs. digital signatures: different needs, different timelines {#timelines}
40+
41+
In TLS, there are two main cryptographic operations we need to secure:
42+
43+
**Key Exchange**: This is how the client and server agree on a shared secret to
44+
encrypt their communication. If an attacker records encrypted traffic today,
45+
they could decrypt it in the future, if they gain access to a quantum computer
46+
capable of breaking the key exchange. This makes migrating KEMs to PQC an
47+
immediate priority.
48+
49+
**Digital Signatures**: These are primarily used to authenticate the server (and
50+
sometimes the client) via certificates. The authenticity of a server is
51+
verified at the time of connection. While important, the risk of an attack
52+
today is much lower, because the decision of trusting a server cannot be abused
53+
after the fact. Additionally, current PQC signature schemes often come with
54+
significant computational overhead and larger key/signature sizes compared to
55+
their classical counterparts.
56+
57+
Another significant hurdle in the migration to PQ certificates is the upgrade
58+
of root certificates. These certificates have long validity periods and are
59+
installed in many devices and operating systems as trust anchors.
60+
61+
Given these differences, the focus for immediate PQC adoption in TLS has been
62+
on hybrid key exchange mechanisms. These combine a classical algorithm (such as
63+
Elliptic Curve Diffie-Hellman Ephemeral (ECDHE)) with a PQC algorithm (such as
64+
`ML-KEM`). The resulting shared secret is secure as long as at least one of the
65+
component algorithms remains unbroken. The `X25519MLKEM768` hybrid scheme is the
66+
most widely supported one.
67+
68+
## State of PQC key exchange mechanisms (KEMs) today {#state-of-kems}
69+
70+
Support for PQC KEMs is rapidly improving across the ecosystem.
71+
72+
**Go**: The Go standard library\'s `crypto/tls` package introduced support for
73+
`X25519MLKEM768` in version 1.24 (released February 2025). Crucially, it\'s
74+
enabled by default when there is no explicit configuration, i.e.,
75+
`Config.CurvePreferences` is `nil`.
76+
77+
**Browsers & OpenSSL**: Major browsers like Chrome (version 131, November 2024)
78+
and Firefox (version 135, February 2025), as well as OpenSSL (version 3.5.0,
79+
April 2025), have also added support for the `ML-KEM` based hybrid scheme.
80+
81+
Apple is also [rolling out support][ApplePQC] for `X25519MLKEM768` in version
82+
26 of their operating systems. Given the proliferation of Apple devices, this
83+
will have a significant impact on the global PQC adoption.
84+
85+
For a more detailed overview of the state of PQC in the wider industry,
86+
see [this blog post by Cloudflare][PQC2024].
87+
88+
## Post-quantum KEMs in Kubernetes: an unexpected arrival
89+
90+
So, what does this mean for Kubernetes? Kubernetes components, including the
91+
API server and kubelet, are built with Go.
92+
93+
As of Kubernetes v1.33, released in April 2025, the project uses Go 1.24. A
94+
quick check of the Kubernetes codebase reveals that `Config.CurvePreferences`
95+
is not explicitly set. This leads to a fascinating conclusion: Kubernetes
96+
v1.33, by virtue of using Go 1.24, supports hybrid post-quantum
97+
`X25519MLKEM768` for TLS connections by default!
98+
99+
You can test this yourself. If you set up a Minikube cluster running Kubernetes
100+
v1.33.0, you can connect to the API server using a recent OpenSSL client:
101+
102+
```console
103+
$ minikube start --kubernetes-version=v1.33.0
104+
$ kubectl cluster-info
105+
Kubernetes control plane is running at https://127.0.0.1:<PORT>
106+
$ kubectl config view --minify --raw -o jsonpath=\'{.clusters[0].cluster.certificate-authority-data}\' | base64 -d > ca.crt
107+
$ openssl version
108+
OpenSSL 3.5.0 8 Apr 2025 (Library: OpenSSL 3.5.0 8 Apr 2025)
109+
$ echo -n "Q" | openssl s_client -connect 127.0.0.1:<PORT> -CAfile ca.crt
110+
[...]
111+
Negotiated TLS1.3 group: X25519MLKEM768
112+
[...]
113+
DONE
114+
```
115+
116+
Lo and behold, the negotiated group is `X25519MLKEM768`! This is a significant
117+
step towards making Kubernetes quantum-safe, seemingly without a major
118+
announcement or dedicated KEP (Kubernetes Enhancement Proposal).
119+
120+
## The Go version mismatch pitfall
121+
122+
An interesting wrinkle emerged with Go versions 1.23 and 1.24. Go 1.23
123+
included experimental support for a draft version of `ML-KEM`, identified as
124+
`X25519Kyber768Draft00`. This was also enabled by default if
125+
`Config.CurvePreferences` was `nil`. Kubernetes v1.32 used Go 1.23. However,
126+
Go 1.24 removed the draft support and replaced it with the standardized version
127+
`X25519MLKEM768`.
128+
129+
What happens if a client and server are using mismatched Go versions (one on
130+
1.23, the other on 1.24)? They won\'t have a common PQC KEM to negotiate, and
131+
the handshake will fall back to classical ECC curves (e.g., `X25519`). How
132+
could this happen in practice?
133+
134+
Consider a scenario:
135+
136+
A Kubernetes cluster is running v1.32 (using Go 1.23 and thus
137+
`X25519Kyber768Draft00`). A developer upgrades their `kubectl` to v1.33,
138+
compiled with Go 1.24, only supporting `X25519MLKEM768`. Now, when `kubectl`
139+
communicates with the v1.32 API server, they no longer share a common PQC
140+
algorithm. The connection will downgrade to classical cryptography, silently
141+
losing the PQC protection that has been in place. This highlights the
142+
importance of understanding the implications of Go version upgrades, and the
143+
details of the TLS stack.
144+
145+
## Limitations: packet size {#limitation-packet-size}
146+
147+
One practical consideration with `ML-KEM` is the size of its public keys
148+
with encoded key sizes of around 1.2 kilobytes for `ML-KEM-768`.
149+
This can cause the initial TLS `ClientHello` message not to fit inside
150+
a single TCP/IP packet, given the typical networking constraints
151+
(most commonly, the standard Ethernet frame size limit of 1500
152+
bytes). Some TLS libraries or network appliances might not handle this
153+
gracefully, assuming the Client Hello always fits in one packet. This issue
154+
has been observed in some Kubernetes-related projects and networking
155+
components, potentially leading to connection failures when PQC KEMs are used.
156+
More details can be found at [tldr.fail].
157+
158+
## State of Post-Quantum Signatures
159+
160+
While KEMs are seeing broader adoption, PQC digital signatures are further
161+
behind in terms of widespread integration into standard toolchains. NIST has
162+
published standards for PQC signatures, such as `ML-DSA` (`FIPS-204`) and
163+
`SLH-DSA` (`FIPS-205`). However, implementing these in a way that\'s broadly
164+
usable (e.g., for PQC Certificate Authorities) [presents challenges]:
165+
166+
**Larger Keys and Signatures**: PQC signature schemes often have significantly
167+
larger public keys and signature sizes compared to classical algorithms like
168+
Ed25519 or RSA. For instance, Dilithium2 keys can be 30 times larger than
169+
Ed25519 keys, and certificates can be 12 times larger.
170+
171+
**Performance**: Signing and verification operations [can be substantially slower].
172+
While some algorithms are on par with classical algorithms, others may have a
173+
much higher overhead, sometimes on the order of 10x to 1000x worse performance.
174+
To improve this situation, NIST is running a
175+
[second round of standardization][NIST2ndRound] for PQC signatures.
176+
177+
**Toolchain Support**: Mainstream TLS libraries and CA software do not yet have
178+
mature, built-in support for these new signature algorithms. The Go team, for
179+
example, has indicated that `ML-DSA` support is a high priority, but the
180+
soonest it might appear in the standard library is Go 1.26 [(as of May 2025)].
181+
182+
[Cloudflare\'s CIRCL] (Cloudflare Interoperable Reusable Cryptographic Library)
183+
library implements some PQC signature schemes like variants of Dilithium, and
184+
they maintain a [fork of Go (cfgo)] that integrates CIRCL. Using `cfgo`, it\'s
185+
possible to experiment with generating certificates signed with PQC algorithms
186+
like Ed25519-Dilithium2. However, this requires using a custom Go toolchain and
187+
is not yet part of the mainstream Kubernetes or Go distributions.
188+
189+
## Conclusion
190+
191+
The journey to a post-quantum secure Kubernetes is underway, and perhaps
192+
further along than many realize, thanks to the proactive adoption of `ML-KEM`
193+
in Go. With Kubernetes v1.33, users are already benefiting from hybrid post-quantum key
194+
exchange in many TLS connections by default.
195+
196+
However, awareness of potential pitfalls, such as Go version mismatches leading
197+
to downgrades and issues with Client Hello packet sizes, is crucial. While PQC
198+
for KEMs is becoming a reality, PQC for digital signatures and certificate
199+
hierarchies is still in earlier stages of development and adoption for
200+
mainstream use. As Kubernetes maintainers and contributors, staying informed
201+
about these developments will be key to ensuring the long-term security of the
202+
platform.
203+
204+
[Shor\'s Algorithm]: https://en.wikipedia.org/wiki/Shor%27s_algorithm
205+
[NIST]: https://www.nist.gov/
206+
[FIPS\-203]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf
207+
[NIST report]: https://nvlpubs.nist.gov/nistpubs/ir/2024/NIST.IR.8547.ipd.pdf
208+
[tldr.fail]: https://tldr.fail/
209+
[presents challenges]: https://blog.cloudflare.com/another-look-at-pq-signatures/#the-algorithms
210+
[can be substantially slower]: https://pqshield.github.io/nist-sigs-zoo/
211+
[(as of May 2025)]: https://github.com/golang/go/issues/64537#issuecomment-2877714729
212+
[Cloudflare\'s CIRCL]: https://github.com/cloudflare/circl
213+
[fork of Go (cfgo)]: https://github.com/cloudflare/go
214+
[PQC2024]: https://blog.cloudflare.com/pq-2024/
215+
[NIST2ndRound]: https://csrc.nist.gov/news/2024/pqc-digital-signature-second-round-announcement
216+
[ApplePQC]: https://support.apple.com/en-lb/122756

0 commit comments

Comments
 (0)