Navigating the treacherous waters of cybersecurity can be a daunting task for today’s IT professionals. IT professionals have to use more tools to defend more systems than ever before against the growing number of potentially disrupting cyberthreats.

The rise of quantum computers raises the stakes and can have a huge impact on the security of our digital communications and data. Why? Because quantum computers are a lot smarter and are equipped with significantly more computing power, decryption capabilities, and digital intelligence than their less-advanced counterparts. This means that quantum computers could succeed in breaking the cryptographic algorithms (RSA, SSL, TLS) that are currently used to secure online communications and transactions – a technological breakthrough that gives rise to new challenges and potentially disastrous consequences.

Is internet security in serious danger? Or can new technology help us withstand possible attacks of quantum computers and allow us to keep our digital data and communication infrastructures safe? Read on to find out.

## What is encryption and why is it important?

The security protocols that protect data and communications utilize encryption. This is the process of converting information into an unreadable format, allowing only authorized parties to access the original data. Encryption is critical when it comes to ensuring the confidentiality and integrity of data, both when the information is stored (at rest) and when it is transmitted over networks (in transit).

## The RSA protocol: origins and process

One of the most popular and advanced present-day encryption protocols is RSA. The protocol is named after the first names of the three scientists who developed this smart piece of security technology: Ron Rivest, Adi Shamir, and Leonard Adleman. In 1977, they invented this revolutionary cryptosystem based on the complexity of factoring large numbers. RSA uses asymmetric cryptography, a technology that utilizes two different keys: a public key to encrypt and a secret key to decrypt.

The RSA protocol relies on the use of prime numbers and modular arithmetic. The process can be divided into the following steps:

- Key generation. A receiver generates a key pair consisting of a public key and a secret key. The public key is shared with others, while the private key must be kept strictly secret.
- Encryption. When someone wants to send a message, they encrypt it using the recipient’s public key. The sender has to raise each character of the message to a certain power and take the modulus (the absolute value of a real or complex number) of the result.
- Decryption. Upon receipt of the encrypted message, the recipient can decrypt it using their secret key. By using the secret key, the encrypted message is returned to its original form and becomes readable.

## The RSA protocol explained as a Java program

Let’s delve a little deeper into the technical side of things by showing you what the RSA protocol looks like if you translate it to a Java program. The following example illustrates this.

` ````
```public class RSAExample {
public static void main(String[] args) {
// Step 1: Choose two prime numbers P and Q
int p = 2;
int q = 7;
// Step 2: Calculate N, the modulus
int n = p * q;
// Step 3: Calculate φ(N), the Euler totient function
int phi = (p - 1) * (q - 1);
// Step 4: Choose a number e that is relatively prime to φ(N)
int e = 5;
// Step 5: Calculate d, the modular inverse of e mod φ(N)
BigInteger d = BigInteger.valueOf(e).modInverse(BigInteger.valueOf(phi));
// Step 6: Publish the public key pair (e, N)
System.out.println("Public key: (" + e + ", " + n + ")");
// Step 7: Keep the private key pair (d, N) safe
System.out.println("Private key: (" + d + ", " + n + ")");
// Step 8: Encrypt a message m with the public key pair (e, N)
int m = 10;
BigInteger encrypted = BigInteger.valueOf(m).modPow(BigInteger.valueOf(e), BigInteger.valueOf(n));
System.out.println("Encrypted message: " + encrypted);
// Step 9: Decrypt the encrypted message with the private key pair (d, N)
BigInteger decrypted = encrypted.modPow(d, BigInteger.valueOf(n));
System.out.println("Decrypted message: " + decrypted);
// Check if the decrypted value matches the original message
System.out.println("Is the decrypted message equal to the original message? " + decrypted.equals(BigInteger.valueOf(m)));

## Taking advantage of prime numbers

The RSA protocol uses the complexity of factoring large numbers to its advantage. While it’s relatively easy to multiply two large prime numbers together, it is vastly more difficult to factorize the original number into its prime factors. This property forms the basis of the security of the RSA protocol and makes it very difficult for malicious parties to decipher the encrypted data.

## How quantum computers can compromise RSA security

Traditional computers are limited to using bits, which can be either 0 or 1. This doesn’t apply to quantum computers – more advanced machines that use qubits, allowing them to be 0 and 1 at the same time. To make things even more complex: qubits can be in an entangled state. This means that the state of one qubit immediately affects the state of the other, even if the two are physically separated. These properties of quantum computers give them even more power – pretty much unprecedented computing power.

Because quantum computers possess an incredible amount of computing power and are capable of harnessing the so-called Shor’s algorithm (an algorithm that uses quantum mechanics to speed up the factorization of large numbers), they are able to calculate the prime factors of a large number in a much shorter time than traditional computers. These abilities threaten popular public key encryption schemes such as the RSA protocol.

If a quantum computer can crack the RSA algorithm (as we speak, the large-scale use of quantum computers with a sufficient number of qubits is still a huge and rarely mastered technical challenge), encrypted data and communications would become vulnerable and could be easily accessed by attackers.

## Preparing for a quantum future with post-quantum cryptography

So, is the future of the internet and digital communications in serious danger due to the rise of quantum computers? It appears to be the case. Fortunately, researchers, security specialists and encryptors are taking action to battle the future threats of large-scale quantum computing by working on new cryptographic algorithms that can withstand the attacks of quantum computers.

This area of research is known as post-quantum cryptography (PQR). New and better algorithms take advantage of mathematical problems that are believed to be difficult to solve even for quantum computers. The goal is to develop a new generation of cryptographic protocols that are able to withstand the increasing threat of quantum computers.

## Conclusion: be prepared for the quantized future

While the RSA protocol still provides a powerful form of encryption in the here and now, it is important to consider the emerging threat of quantum computing. The immense computing power of quantum computers can weaken the RSA protocol and, over time (and maybe faster than we all expect), undermine current layers of security. It is essential that we prepare for this new reality by investing in post-quantum cryptography and new encryption algorithms.