Skip to content

Commit 87ea1d7

Browse files
RebeccaTamachiroLekensteynhyperlint-ai[bot]lukevalentaSulemanAhmadd
authored andcommitted
[SSL] Bring in PQC content to Dev Docs (#18165)
* Add placeholders for new folder and pages and fill in frontmatter * Add outline for index.mdx and fill in TLS background info * Apply suggestion: Reword intro to TLS building blocks Co-authored-by: Peter Wu <[email protected]> * Fix typo and reword index.mdx meta description * Improve parallelism, refine text, and link out to TLS handshake LC * Fill in hybrid key agreement section * Complete visitor-to-cloudflare intro paragraph * Add mermaid digram for connections and reword #2 * Fix Internet capitalization Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> * Rename file, fill in, and link to pqc-support * Fix capitalization and fill in Intenal connections section * Fill in Cf to origin and review titles and headings * Fix missing hyphen and touch up pqc-to-origin description * Add split ClientHello and HRR workaround to pqc-to-origin * Add setup instructions to pqc-to-origin * Apply suggestion from code review Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Luke Valenta <[email protected]> Co-authored-by: Suleman Ahmad <[email protected]> * Replace store by harvest, adjust RFC link cf Style Guide, and split long paragarph * Add reference to PQ signatures and link out to blog * Fix origin server section to use fork and bssl for both cases * Add link to Cloudflare Radar Co-authored-by: Luke Valenta <[email protected]> * Text review and move link to Radar higher up in the page * Simplify origin server instructions to use BoringSSL instead of fork Co-authored-by: Suleman Ahmad <[email protected]> * Overall text review and remove previous origin instructions * Apply suggestion from code review Co-authored-by: Jun Lee <[email protected]> --------- Co-authored-by: Peter Wu <[email protected]> Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> Co-authored-by: Luke Valenta <[email protected]> Co-authored-by: Suleman Ahmad <[email protected]> Co-authored-by: Jun Lee <[email protected]>
1 parent 543fe38 commit 87ea1d7

File tree

3 files changed

+189
-0
lines changed

3 files changed

+189
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
pcx_content_type: concept
3+
title: Post-quantum cryptography (PQC)
4+
sidebar:
5+
order: 9
6+
label: About PQC
7+
group:
8+
label: Post-quantum
9+
head: []
10+
description: Get an overview of how Cloudflare is deploying post-quantum cryptography to protect you against harvest now, decrypt later.
11+
---
12+
13+
Post-quantum cryptography (PQC) refers to cryptographic algorithms that have been designed to resist attacks from [quantum computers](https://www.cloudflare.com/learning/ssl/quantum/what-is-quantum-computing/). Cloudflare has been researching and [writing about post-quantum](https://blog.cloudflare.com/tag/post-quantum/) since 2017.
14+
15+
To protect you against the risk of [harvest now, decrypt later](https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later), and considering all the [connections](#three-connections-in-the-life-of-a-request) that take place when your website or application is on Cloudflare, we have deployed and are actively expanding the use of [post-quantum hybrid key agreement](#hybrid-key-agreement).
16+
17+
Refer to [Cloudflare Radar](https://radar.cloudflare.com/adoption-and-usage#post-quantum-encryption-adoption) for current statistics on the adoption of PQ encryption in requests to Cloudflare.
18+
19+
:::caution[TLS 1.3]
20+
Cloudflare post-quantum key agreements are only supported in protocols based on TLS 1.3 (including HTTP/3) and are disabled for websites in [FIPS mode](/cloudflare-one/policies/gateway/http-policies/tls-decryption/#fips-compliance).
21+
:::
22+
23+
## Three building blocks of TLS
24+
25+
Before TLS can protect your communications, three cryptographic algorithms have to be agreed on during the [TLS handshake](https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/):
26+
27+
- **Symmetric ciphers:** Algorithms used to encrypt and decrypt data, ensuring confidentiality and integrity (such as `CHACHA20-POLY1305`).
28+
- **Key agreement:** A cryptographic protocol that allows client and server to safely agree on a shared key (such as `ECDH`).
29+
- **Signature algorithms:** Cryptographic algorithms used to generate the digital signatures in TLS certificates (such as `RSA` and `ECDSA`).
30+
31+
As explained in our [blog post](https://blog.cloudflare.com/pq-2024/#two-migrations), symmetric ciphers are already post-quantum secure, which means there are two migrations left to occur.
32+
33+
### Hybrid key agreement
34+
35+
With TLS 1.3, [X25519](https://en.wikipedia.org/wiki/Curve25519) - an Elliptic Curve Diffie-Hellman (ECDH) protocol - is the most commonly used algorithm in key agreement. However, its security can be easily broken by quantum computers using [Shor's algorithm](https://en.wikipedia.org/wiki/Shor%27s_algorithm).
36+
37+
It is urgent to migrate key agreement to post-quantum algorithms as soon as possible. The objective is to protect against an adversary capable of harvesting today's encrypted communications and storing it until some time in the future when they can gain access to a sufficiently powerful quantum computer to decrypt it.
38+
39+
In response to this, Cloudflare is an early adopter of ML-KEM, the post-quantum key agreement selected by the US National Institute of Standards and Technology (NIST). For a detailed timeline and more background information refer to [The state of the post-quantum Internet](https://blog.cloudflare.com/pq-2024/).
40+
41+
Cloudflare has deployed the following hybrid key agreements:
42+
43+
- [X25519MLKEM768](https://datatracker.ietf.org/doc/draft-kwiatkowski-tls-ecdhe-mlkem/) (Recommended)
44+
- TLS identifier: `0x11ec`
45+
- [X25519Kyber768Draft00](https://datatracker.ietf.org/doc/draft-tls-westerbaan-xyber768d00/) (Obsolete)
46+
- TLS identifier: `0x6399`
47+
48+
A hybrid key agreement lays the groundwork as more and more [clients](#1-visitor-to-cloudflare) adopt post-quantum cryptography, while also maintaining the current security provided by X25519. It is a safer path in case of an unexpected breakthrough that renders all variants of ML-KEM insecure.
49+
50+
### Post-quantum signatures
51+
52+
The migration to post-quantum signatures is less urgent and more involved. Cloudflare is closely following the developments of new standards, testing their performance, and working together with browsers to understand user impact.
53+
54+
For details refer to [A look at the latest post-quantum signature standardization candidates](https://blog.cloudflare.com/another-look-at-pq-signatures/).
55+
56+
## Three connections in the life of a request
57+
58+
```mermaid
59+
flowchart LR
60+
accTitle: Three connections - from visitor to Cloudflare to origin server
61+
accDescr: Diagram showing connections for an uncached request.
62+
A[Visitor]
63+
subgraph Cloudflare
64+
X[(Cloudflare <br />service A)]
65+
B[(Cloudflare <br />service B)]
66+
end
67+
C[(Origin server)]
68+
69+
A --1--> X
70+
X --2--> B
71+
B --3--> C
72+
```
73+
74+
### 1. Visitor to Cloudflare
75+
76+
As of [October 2022](https://blog.cloudflare.com/post-quantum-for-all/), all websites and APIs served through Cloudflare over TLS 1.3 support post-quantum hybrid key agreement. However, the connection is only post-quantum secured if the client also supports PQC.
77+
78+
Refer to [Post-quantum cryptography support](/ssl/post-quantum-cryptography/pqc-support/) for a list of browsers and other clients that are compatible with hybrid key agreements.
79+
80+
### 2. Internal connections
81+
82+
As announced in [September 2023](https://blog.cloudflare.com/post-quantum-cryptography-ga/), most internal connections for Cloudflare's products and systems have been upgraded to use PQC.
83+
84+
### 3. Cloudflare to your origin
85+
86+
Finally, Cloudflare also supports [hybrid key agreements](#hybrid-key-agreement) when connecting to origins. In this case, post-quantum secured connections will depend on the origin servers also supporting PQC.
87+
88+
Refer to [Post-quantum cryptography between Cloudflare and origin servers](/ssl/post-quantum-cryptography/pqc-to-origin/) for details.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
pcx_content_type: reference
3+
title: PQC support
4+
sidebar:
5+
order: 2
6+
head: []
7+
description: Consider information about post-quantum cryptography at Cloudflare - deployed key agreements and software support.
8+
---
9+
10+
Cloudflare's deployment of post-quantum [hybrid key agreements](/ssl/post-quantum-cryptography/#hybrid-key-agreement) is supported by different software as listed below.
11+
12+
## X25519MLKEM768
13+
- Default for [Firefox 132+](https://www.mozilla.org/firefox/channel/desktop/) (Beta)
14+
- Default for [Chrome 131+](https://www.google.com/chrome/beta/) (Beta)
15+
- Cloudflare's [fork of Go](https://github.com/cloudflare/go)
16+
- [BoringSSL](https://boringssl.googlesource.com/boringssl/)
17+
18+
## X25519Kyber768Draft00
19+
20+
- Default for [Chrome 124-130](https://www.google.com/chrome/) on Desktop
21+
- For older Chrome or on mobile, toggle _TLS 1.3 hybridized Kyber support_ (`enable-tls13-kyber`) in `chrome://flags`.
22+
- Default for [Edge 124+](https://microsoft.com/edge/)
23+
- Default for recent [Opera](https://opera.com) and [Brave](https://brave.com)
24+
- [Firefox 124+](https://www.mozilla.org/firefox) if you turn on `security.tls.enable_kyber` in `about:config`
25+
- For QUIC/HTTP3, use Firefox 128+ with `network.http.http3.enable_kyber`.
26+
- Cloudflare's [fork of Go](https://github.com/cloudflare/go)
27+
- Default for [Go 1.23](https://github.com/golang/go/issues/67061)
28+
- [BoringSSL](https://boringssl.googlesource.com/boringssl/)
29+
- Cloudflare's [fork of QUIC-go](https://github.com/cloudflare/qtls-pq)
30+
- Goutam Tamvada's [fork of Firefox](https://github.com/xvzcf/firefox-pq-demos)
31+
- [Open Quantum Safe](https://openquantumsafe.org/) C library
32+
- [Zig 0.11.0+](https://ziglang.org/)
33+
- [nginx](https://www.nginx.org/) when [compiled with BoringSSL](https://mailman.nginx.org/pipermail/nginx/2023-August/NOISOYU3QTB2DGIYUBGF7CAMQHDI2QLT.html) ([guide](https://blog.centminmod.com/2023/10/03/2860/how-to-enable-cloudflare-post-quantum-x25519kyber768-key-exchange-support-in-centmin-mod-nginx/))
34+
- [Caddy HTTP server](https://caddyserver.com/) nightly [compiled with Go 1.23+](https://gist.github.com/bwesterb/2f7bfa7ae689de0d242b56ea3ecac424)
35+
- [Botan C++ library 3.2.0+](https://botan.randombit.net/) ([instructions](https://github.com/randombit/botan/discussions/3747))
36+
- ISRG's fork of [Rustls](https://www.memorysafety.org/blog/pq-key-exchange/)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
pcx_content_type: how-to
3+
title: Post-quantum between Cloudflare and origin servers
4+
sidebar:
5+
order: 3
6+
label: PQC to your origin
7+
head: []
8+
description: Learn about post-quantum cryptography in connections from Cloudflare to your origin servers.
9+
---
10+
11+
import { Example } from "~/components";
12+
13+
As explained in [About PQC](/ssl/post-quantum-cryptography/), Cloudflare has deployed support for hybrid key agreements, which includes both the most common key agreement for TLS 1.3, X25519, and the post-quantum secure ML-KEM.
14+
15+
With X25519, the [ClientHello](https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/) almost always fits within one network packet. However, with the addition of ML-KEM, the ClientHello is typically split across two packets.
16+
17+
This poses a question of how the origin servers - as well as other middleboxes (routers, load balancers, etc) - will handle this change in behavior. Although allowed by the TLS 1.3 standard ([RFC 8446](https://www.rfc-editor.org/rfc/rfc8446.html)), a split ClientHello risks not being handled well due to [protocol ossification](https://en.wikipedia.org/wiki/Protocol_ossification) and implementation bugs. Refer to our [blog post](https://blog.cloudflare.com/post-quantum-to-origins/) for details.
18+
19+
## ClientHello from Cloudflare
20+
21+
To reduce the risk of any issues when connecting to servers that are not ready for hybrid key agreements, Cloudflare leverages HelloRetryRequest. This means that, instead of sending [X25519MLKEM768](/ssl/post-quantum-cryptography/#hybrid-key-agreement) immediately as a keyshare [^1], Cloudflare will by default only advertise support for it.
22+
23+
If the origin supports post-quantum hybrid key agreement, it can use HelloRetryRequest to request it from Cloudflare.
24+
25+
## Set up
26+
27+
### Cloudflare zone settings
28+
29+
The method described above is the one Cloudflare uses to support post-quantum to all outbound connections. However, if your origin server supports PQC and prefers it, you can use the [API](/api/operations/zone-cache-settings-change-origin-post-quantum-encryption-setting) to adjust your Cloudflare zone settings and avoid the extra round trip.
30+
31+
It is also possible to opt out of PQC using the same API endpoint.
32+
33+
:::note
34+
This setting affects all outbound connections from the zone you specify in the API call, including `fetch()` requests made by [Workers](/workers/) on your zone.
35+
:::
36+
37+
```bash
38+
curl --request PUT \
39+
"https://api.cloudflare.com/client/v4/zones/{zone_id}/cache/origin_post_quantum_encryption" \
40+
--header "Authorization: Bearer <API_TOKEN>" \
41+
--header "Content-Type: application/json" \
42+
--data '{
43+
"value": "<YOUR_CHOSEN_SETTING>"
44+
}'
45+
```
46+
47+
The possible values are:
48+
- `supported` (most compatible): Advertise support for post-quantum key agreement, but send a classical keyshare in the first ClientHello.
49+
- `preferred` (most performant): Send a post-quantum keyshare in the first ClientHello. Cloudflare continues to advertise support for classical keyshares as well.
50+
- `off`: Do not send nor advertise support for post-quantum key agreement to the origin.
51+
52+
### Origin server
53+
54+
To make sure that your origin server prefers the post-quantum key agreement, use the `bssl` tool of [BoringSSL](https://github.com/google/boringssl):
55+
56+
<Example>
57+
```bash
58+
$ bssl client -connect (your server):443 -curves X25519MLKEM768
59+
```
60+
61+
Verify that the `ECDHE curve` in the handshake output indicates `X25519MLKEM768`.
62+
63+
</Example>
64+
65+
[^1]: When, to remove a round trip, a client makes a guess of what the server supports.

0 commit comments

Comments
 (0)