Repository navigation
doc(auth): add PQC product neutral guide #16548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+88
−2
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Google Cloud Platform C++ Client Libraries: Post-Quantum Cryptography (PQC) | ||
|
|
||
| The Google Cloud C++ Client Libraries support Post-Quantum Cryptography (PQC) | ||
| for TLS 1.3 connections to protect network traffic against "harvest now, decrypt | ||
| later" attacks. | ||
|
|
||
| By default, both gRPC and REST transports negotiate the hybrid post-quantum key | ||
| exchange mechanism **`X25519MLKEM768`** (combining classical `X25519` ECDH with | ||
| NIST-standardized `ML-KEM-768`) whenever supported by the underlying TLS and | ||
| cryptographic libraries. | ||
|
|
||
| ## 1. Default Behavior by Transport | ||
|
|
||
| No code changes are required to use PQC when building with supported dependency | ||
| versions: | ||
|
|
||
| | Transport | Default Behavior | Minimum Dependency Requirements | | ||
| | --------- | ----------------------------------------------------------- | ------------------------------------------------------ | | ||
| | **gRPC** | Enabled automatically by gRPC and its TLS stack. | gRPC built with BoringSSL or OpenSSL >= 3.5.0 | | ||
| | **REST** | `X25519MLKEM768` is prioritized in `CURLOPT_SSL_EC_CURVES`. | `libcurl >= 7.73.0` with BoringSSL or OpenSSL >= 3.5.0 | | ||
|
|
||
| ### REST Transport Details | ||
|
|
||
| When creating a REST connection, the library inspects the linked `libcurl` and | ||
| SSL/TLS libraries at runtime. If `X25519MLKEM768` is available, it is prepended | ||
| to the list of supported TLS groups passed to `libcurl`. | ||
|
|
||
| If the runtime environment does not support `X25519MLKEM768` (for example, when | ||
| linked against OpenSSL < 3.5.0 or `libcurl < 7.73.0`), the client logs an | ||
| informational (`INFO`) message and falls back to the default classical curves. | ||
|
|
||
| ## 2. Disabling Post-Quantum Cryptography | ||
|
|
||
| In certain network environments, legacy firewalls, proxies, or middleboxes may | ||
| drop or time out TLS handshakes containing larger hybrid post-quantum | ||
| `ClientHello` key shares. If you encounter TLS handshake failures, you can opt | ||
| out of PQC. | ||
|
|
||
| ### Disabling PQC with REST | ||
|
|
||
| Set the `GOOGLE_CLOUD_CPP_DISABLE_PQC` environment variable to any value before | ||
| starting your application: | ||
|
|
||
| ``` | ||
| export GOOGLE_CLOUD_CPP_DISABLE_PQC="true" | ||
| ./my_application | ||
| ``` | ||
|
|
||
| When `GOOGLE_CLOUD_CPP_DISABLE_PQC` is set, the REST client does not prioritize | ||
| `X25519MLKEM768` and leaves the underlying SSL library's default curve order | ||
| unchanged. | ||
|
|
||
| ### Disabling PQC with gRPC | ||
|
|
||
| The `GOOGLE_CLOUD_CPP_DISABLE_PQC` environment variable only applies to REST | ||
| clients. Neither `google-cloud-cpp` nor upstream C++ gRPC provides an | ||
| environment variable to disable `X25519MLKEM768` on default credentials. | ||
|
|
||
| To restrict a gRPC client to classical TLS key exchange groups, configure custom | ||
| TLS channel credentials using `grpc::experimental::TlsChannelCredentialsOptions` | ||
| and pass them via `google::cloud::GrpcCredentialOption`: | ||
|
|
||
| ```cpp | ||
| #include "google/cloud/common_options.h" | ||
| #include "google/cloud/grpc_options.h" | ||
| #include <grpcpp/grpcpp.h> | ||
| #include <grpcpp/security/tls_credentials_options.h> | ||
|
|
||
| google::cloud::Options ConfigureClassicalTlsForGrpc( | ||
| std::shared_ptr<grpc::CallCredentials> call_credentials) { | ||
| grpc::experimental::TlsChannelCredentialsOptions tls_options; | ||
| tls_options.set_key_exchange_groups({ | ||
| GRPC_TLS_KEY_EXCHANGE_GROUP_X25519, | ||
| GRPC_TLS_KEY_EXCHANGE_GROUP_SECP256R1, | ||
| }); | ||
|
|
||
| auto channel_credentials = grpc::CompositeChannelCredentials( | ||
| grpc::experimental::TlsCredentials(tls_options), | ||
| std::move(call_credentials)); | ||
|
|
||
| return google::cloud::Options{} | ||
| .set<google::cloud::GrpcCredentialOption>(std::move(channel_credentials)); | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.