Using hybrid post-quantum TLS with AWS KMS
AWS Key Management Service (AWS KMS) supports a hybrid post-quantum key exchange option for the Transport Layer Security (TLS) network encryption protocol. You can use this TLS option when you connect to AWS KMS API endpoints. We're offering this feature before post-quantum algorithms are standardized so you can begin testing the effect of these key exchange protocols on AWS KMS calls. These optional hybrid post-quantum key exchange features are at least as secure as the TLS encryption we use today and are likely to provide additional long-term security benefits. However, they affect latency and throughput compared to the classic key exchange protocols in use today.
The data that you send to AWS Key Management Service (AWS KMS) is protected in transit by the encryption provided by a Transport Layer Security (TLS) connection. The classic cipher suites that AWS KMS supports for TLS sessions make brute force attacks on the key exchange mechanisms infeasible with current technology. However, if large-scale quantum computing becomes practical in the future, the classic cipher suites used in TLS key exchange mechanisms will be susceptible to these attacks. If you’re developing applications that rely on the long-term confidentiality of data passed over a TLS connection, you should consider a plan to migrate to post-quantum cryptography before large-scale quantum computers become available for use. AWS is working to prepare for this future, and we want you to be well-prepared, too.
To protect data encrypted today against potential future attacks, AWS is participating with the cryptographic community in the development of quantum-resistant or post-quantum algorithms. We've implemented hybrid post-quantum key exchange cipher suites in AWS KMS that combine classic and post-quantum elements to ensure that your TLS connection is at least as strong as it would be with classic cipher suites.
These hybrid cipher suites are available for use on your production workloads in most AWS Regions. However, because the performance characteristics and bandwidth requirements of hybrid cipher suites are different from those of classic key exchange mechanisms, we recommend that you test them on your AWS KMS API calls under different conditions.
As always, we welcome your feedback and participation in our open-source repositories. We’d especially like to hear how your infrastructure interacts with this new variant of TLS traffic.
-
To provide feedback on this topic, use the Feedback link in the upper right corner of this page.
-
We're developing these hybrid cipher suites in open source in the s2n-tls
repository on GitHub. To provide feedback on the usability of the cipher suites, or share novel test conditions or results, create an issue in the s2n-tls repository. -
We're writing code samples for using hybrid post-quantum TLS with AWS KMS in the aws-kms-pq-tls-example
GitHub repository. To ask questions or share ideas about configuring your HTTP client or AWS KMS client to use the hybrid cipher suites, create an issue in the aws-kms-pq-tls-example repository.
Post-quantum TLS for AWS KMS is available in all AWS Regions that AWS KMS supports except for AWS GovCloud (US-East), AWS GovCloud (US-West), China (Beijing), and China (Ningxia).
For a list of AWS KMS endpoints for each AWS Region, see AWS Key Management Service endpoints and quotas in the Amazon Web Services General Reference. For information about FIPS endpoints, see FIPS endpoints in the Amazon Web Services General Reference.
About hybrid post-quantum key exchange in TLS
AWS KMS supports hybrid post-quantum key exchange cipher suites. You can use the AWS SDK for Java 2.x and AWS Common Runtime on Linux systems to configure an HTTP client that uses these cipher suites. Then, whenever you connect to an AWS KMS endpoint with your HTTP client, the hybrid cipher suites are used.
This HTTP client uses s2n-tls
The algorithms that s2n-tls uses are a hybrid that combines Elliptic Curve
Diffie-Hellman
If ongoing research reveals that the Kyber algorithm lacks the anticipated post-quantum strength, the hybrid key is still at least as strong as the single ECDH key currently in use. Until research on post-quantum algorithms is complete, we recommend using hybrid algorithms, rather than using post-quantum algorithms alone.
Using hybrid post-quantum TLS with AWS KMS
You can use hybrid post-quantum TLS for your calls to AWS KMS. When setting up your HTTP client test environment, be aware of the following information:
Encryption in Transit
The hybrid cipher suites in s2n-tls are used only for encryption in transit. They protect your data while it is traveling from your client to the AWS KMS endpoint. AWS KMS does not use these cipher suites to encrypt data under AWS KMS keys.
Instead, when AWS KMS encrypts your data under KMS keys, it uses symmetric cryptography with
256-bit keys and the Advanced Encryption Standard in Galois Counter Mode (AES-GCM) algorithm,
which is already quantum resistant. Theoretical future, large-scale quantum computing attacks
on ciphertexts created under 256-bit AES-GCM keys reduce the
effective security of the key to 128 bits
Supported Systems
Use of the hybrid cipher suites in s2n-tls is currently supported only on Linux systems. In addition, these cipher suites are supported only in SDKs that support the AWS Common Runtime, such as the AWS SDK for Java 2.x. For an example, see How to configure hybrid post-quantum TLS.
AWS KMS Endpoints
When using the hybrid cipher suites, use the standard AWS KMS endpoint. The hybrid cipher suites in s2n-tls are not compatible with the FIPS 140-2 validated endpoints for AWS KMS.
When you configure a HTTP client to prefer post-quantum TLS connections with s2n-tls, the post-quantum ciphers are first in the cipher preference list. However, the preference list includes the classic, non-hybrid ciphers lower in the preference order for compatibility. When you configure an HTTP client to prefer post-quantum TLS with an AWS KMS FIPS 140-2 validated endpoint, s2n-tls negotiates a classic, non-hybrid key exchange cipher.
For a list of AWS KMS endpoints for each AWS Region, see AWS Key Management Service endpoints and quotas in the Amazon Web Services General Reference. For information about FIPS endpoints, see FIPS endpoints in the Amazon Web Services General Reference.
Expected Performance
Our early benchmark testing shows that the hybrid cipher suites in s2n-tls
are slower than classic TLS cipher suites. The effect varies based on the network profile, CPU
speed, the number of cores, and your call rate. For performance test results, see How to tune TLS for hybrid post-quantum cryptography with Kyber
How to configure hybrid post-quantum TLS
In this procedure, add a Maven dependency for the AWS Common Runtime HTTP Client. Next, configure an HTTP client that prefers post-quantum TLS. Then, create an AWS KMS client that uses the HTTP client.
To see a complete working examples of configuring and using hybrid post-quantum TLS with
AWS KMS, see the aws-kms-pq-tls-example
Note
The AWS Common Runtime HTTP Client, which has been available as a preview, became
generally available in February 2023. In that release, the tlsCipherPreference
class and the tlsCipherPreference()
method parameter are replaced by the
postQuantumTlsEnabled()
method parameter. If you were using this example
during the preview, you need to update your code.
-
Add the AWS Common Runtime client to your Maven dependencies. We recommend using the latest available version.
For example, this statement adds version
2.20.0
of the AWS Common Runtime client to your Maven dependencies.<dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>aws-crt-client</artifactId> <version>2.20.0</version> </dependency>
-
To enable the hybrid post-quantum cipher suites, add the AWS SDK for Java 2.x to your project and initialize it. Then enable the hybrid post-quantum cipher suites on your HTTP client as shown in the following example.
This code uses the
postQuantumTlsEnabled()
method parameter to configure an AWS common runtime HTTP client that prefers the recommended hybrid post-quantum cipher suite, ECDH with Kyber. Then it uses the configured HTTP client to build an instance of the AWS KMS asynchronous client,KmsAsyncClient
. After this code completes, all AWS KMS API requests on the KmsAsyncClient
instance use hybrid post-quantum TLS.// Configure HTTP client SdkAsyncHttpClient awsCrtHttpClient = AwsCrtAsyncHttpClient.builder() .postQuantumTlsEnabled(true) .build(); // Create the AWS KMS async client KmsAsyncClient kmsAsync = KmsAsyncClient.builder() .httpClient(awsCrtHttpClient) .build();
-
Test your AWS KMS calls with hybrid post-quantum TLS.
When you call AWS KMS API operations on the configured AWS KMS client, your calls are transmitted to the AWS KMS endpoint using hybrid post-quantum TLS. To test your configuration, call an AWS KMS API, such as
ListKeys
.ListKeysReponse keys = kmsAsync.listKeys().get();
Testing hybrid post-quantum TLS with AWS KMS
Consider running the following tests with hybrid cipher suites on your applications that call AWS KMS.
-
Run load tests and benchmarks. The hybrid cipher suites perform differently than traditional key exchange algorithms. You might need to adjust your connection timeouts to allow for the longer handshake times. If you’re running inside an AWS Lambda function, extend the execution timeout setting.
-
Try connecting from different locations. Depending on the network path your request takes, you might discover that intermediate hosts, proxies, or firewalls with deep packet inspection (DPI) block the request. This might result from using the new cipher suites in the ClientHello
part of the TLS handshake, or from the larger key exchange messages. If you have trouble resolving these issues, work with your security team or IT administrators to update the relevant configuration and unblock the new TLS cipher suites.
Learn more about post-quantum TLS in AWS KMS
For more information about using hybrid post-quantum TLS in AWS KMS, see the following resources.
-
To learn about post-quantum cryptography at AWS, including links to blog posts and research papers, see Post-Quantum Cryptography
. -
For information about s2n-tls, see Introducing s2n-tls, a New Open Source TLS Implementation
and Using s2n-tls . -
For information about the AWS Common Runtime HTTP Client, see Configuring the AWS CRT-based HTTP client in the AWS SDK for Java 2.x Developer Guide.
-
For information about the post-quantum cryptography project at the National Institute for Standards and Technology (NIST), see Post-Quantum Cryptography
. -
For information about NIST post-quantum cryptography standardization, see Post-Quantum Cryptography Standardization
.