In our increasingly interconnected digital world, the foundations of secure communication and data privacy are built upon cryptographic algorithms that have stood the test of time. However, the advent of quantum computing poses a significant threat to these cryptographic standards, potentially rendering them obsolete. This article delves into the quantum threat to API security and explores how organizations can prepare their APIs for “Q-Day”—the day when quantum computers can break current cryptographic algorithms.
Understanding the Quantum Threat
Today, secure authentication, authorization, encryption, and data integrity rely heavily on public key cryptography, specifically RSA and elliptic curve algorithms. These algorithms enable secure key exchange and underpin the security protocols that protect our digital communications.
While symmetric cryptography plays a crucial role in securing data, it often depends on asymmetric cryptography for key exchange. The integrity of our digital world hinges on the unassailability of these asymmetric algorithms.
Enter quantum computing. With the development of quantum computers, algorithms like Shor’s algorithm can exploit quantum mechanics to factor large numbers efficiently, effectively breaking RSA and elliptic curve cryptography. Once quantum computers reach a sufficient level of power (measured in qubits), they could decrypt data, impersonate users, and compromise the security of digital communications worldwide.
A Solution Without Quantum Computers
Despite the looming threat, there’s no need to panic. The solution lies in developing new cryptographic algorithms that are resistant to quantum attacks, known as post-quantum cryptography (PQC). These algorithms are designed to be secure against both classical and quantum computers.
The beauty of PQC is that it doesn’t require quantum computers for implementation. These new standards are compatible with current computing infrastructure and are being formalized by organizations like the National Institute of Standards and Technology (NIST). In 2024, NIST closed the comment period for these new standards, signaling a significant step toward widespread adoption.
API-Specific Exposure to Quantum Threats
APIs are the backbone of modern applications, facilitating communication between services. They rely on numerous secure connection points and access control mechanisms, all of which utilize public key cryptography.
Consider the various interactions in an API ecosystem:
- Secure Communications: Between API gateways and identity providers.
- Key Exchange and Rotation: Retrieval and rotation of JSON Web Key (JWK) sets for token validation.
- Policy Enforcement: Accessing external data sources for enforcing security policies.
- Microservices Communication: Secure API calls between microservices.
These interactions, secured by RSA and elliptic curve algorithms, are vulnerable in a post-quantum world.
Access control mechanisms like JSON Web Tokens (JWTs), OAuth tokens, and message-level signatures also depend on public key cryptography. An attacker with a quantum computer could potentially forge tokens, impersonate users, and bypass authentication mechanisms, leading to significant security breaches.
Example Exploit: JWT-Based API Access Control
Let’s examine a common scenario where an API uses JWTs for access control:
- Token Issuance: An identity provider issues a JWT to a client application after authenticating a user.
- Token Usage: The client application uses the JWT to access the API.
- Token Validation: The API gateway validates the token’s signature using a public key retrieved from the identity provider.
In a post-quantum world, an attacker could:
- Obtain the Public Key: Access the publicly available JWK set.
- Derive the Private Key: Use Shor’s algorithm on a quantum computer to derive the private key from the public key.
- Forge Tokens: Create valid tokens that can impersonate any user or grant any permissions.
- Bypass Security: Access the API without detection, leading to data breaches and unauthorized actions.
Transitioning to Post-Quantum JWTs
To mitigate this threat, both token issuers and resource servers need to adopt PQC algorithms:
- Token Issuers: Must sign JWTs using quantum-resistant algorithms.
- Resource Servers: Must be capable of validating these new signatures.
However, current JWT standards specify algorithms based on RSA and elliptic curve cryptography. The JSON Web Signature (JWS) and JSON Web Algorithms (JWA) specifications define the acceptable algorithms, all of which are vulnerable to quantum attacks. Updating these standards to support PQC algorithms is essential, involving:
- Extending Specifications: Including new quantum-resistant algorithms in the standards.
- Ensuring Compatibility: Maintaining interoperability across different systems and platforms.
- Updating Libraries and Tools: Modifying existing cryptographic libraries to support PQC.
A Practical Implementation: PQC JWT Proof of Concept
At Layer7, we embarked on a proof of concept (POC) to implement PQC in JWTs. Recognizing the imperative for crypto agility, we modified existing libraries to support quantum-resistant algorithms:
- Forking Existing Libraries: We modified the
jose4j
Java library to add support for the Dilithium algorithm—a quantum-resistant digital signature scheme. - Utilizing Cryptography Providers: Integrated Bouncy Castle, a cryptography provider that supports PQC algorithms, into our application.
- Rebuilding the API Gateway: Made necessary changes to our API gateway to handle new key types and algorithms.
- Creating Endpoints: Developed endpoints for token creation and validation using the new PQC algorithms.
The result was a functioning system capable of issuing and validating post-quantum JWTs, demonstrating that PQC integration is feasible with current technology.
Performance Comparison: Dilithium vs. RSA 2048
One concern when adopting new cryptographic algorithms is the potential performance impact. We compared the performance of Dilithium to RSA 2048, commonly used today:
- Token Size: Dilithium signatures resulted in larger token sizes due to bigger key sizes, but the increase was manageable for most applications.
- Signing Performance: Signing with Dilithium was slightly faster than with RSA 2048.
- Validation Performance: Signature validation saw a minor decrease in performance with Dilithium but was not significant enough to pose a problem.
These results indicate that transitioning to PQC algorithms may not impose a prohibitive performance penalty, making adoption more feasible.
When Is Q-Day?
A critical question is determining when quantum computers will reach the capability to break current cryptographic algorithms—a moment referred to as “Q-Day.” While it’s challenging to predict precisely, several indicators suggest it could be within the next decade:
- Advancements in Quantum Algorithms: Research shows a trend of decreasing qubit requirements and computation time to break RSA 2048 using Shor’s algorithm.
- Progress in Quantum Hardware: Quantum computers are rapidly evolving, with IBM’s Condor processor surpassing 1,000 qubits in 2023.
Given the pace of development, organizations should not wait for an exact date but begin preparing now to ensure they are not caught off guard.
Time to Retrofit
Organizations need to consider the time required to transition to PQC algorithms. Large enterprises, especially those with complex architectures and legacy systems, may require several years to complete the migration:
- Complex Architectures: Multi-layered systems with numerous dependencies complicate the retrofit process.
- Legacy Systems: Older infrastructure may lack the necessary crypto agility, necessitating replacements or significant updates.
- Transition Period: Supporting both traditional and PQC algorithms during the migration adds to the complexity and duration.
Factoring in these challenges, organizations should begin planning their transition strategies promptly to meet future security demands.
Developing a Quantum Readiness Roadmap
To prepare for Q-Day, organizations should:
- Assign a Dedicated Team: Establish a team responsible for planning and overseeing the migration to PQC.
- Conduct a Crypto Inventory: Identify where and how cryptography is used within the organization, focusing on critical areas.
- Prioritize Critical Systems: Determine which systems are most at risk and prioritize their migration.
- Engage with Technology Providers: Collaborate with vendors to ensure they have the necessary crypto agility and support for PQC algorithms.
- Plan for an Overlapping Transition: Develop strategies to support both current and PQC algorithms during the migration period.
By proactively addressing these steps, organizations can mitigate risks associated with the quantum threat and ensure the continued security of their APIs.
The impending arrival of quantum computing capabilities necessitates a proactive approach to securing our digital infrastructure. APIs, as critical components of modern applications, must be prepared for the quantum threat. By understanding the risks, implementing post-quantum cryptographic algorithms, and planning a thorough migration strategy, organizations can safeguard their systems against future attacks.
The time to act is now. While the exact date of Q-Day remains uncertain, the steps required to prepare are clear. Embracing crypto agility and transitioning to quantum-resistant algorithms will ensure that APIs remain secure in the face of emerging quantum technologies.