What is RSA encryption, how does it work, and is it still secure?

Introduced in 1977, Rivest-Shamir-Adleman (RSA) encryption is one of the oldest public-key cryptography systems still in use today. It helps verify website identities, authenticate software, and protect encrypted emails. However, recent rumors about AI labs discovering a way to break RSA encryption have raised questions about its future. Learn how RSA encryption works, where it's used, how secure it is today, and what recent AI factoring rumors and advances in quantum computing could mean for its future.

Laptop showing encrypted data.

RSA encryption definition

RSA is a public-key cryptography system for establishing secure connections and creating digital signatures.

RSA encryption got its name from the surnames of its creators, Rivest, Shamir, and Adleman, who described the algorithm while working at the Massachusetts Institute of Technology back in 1977.

RSA uses a public key for the encryption of the message and a private key for its decryption. The math behind the RSA encryption algorithm includes a one-way function – it’s easy to calculate but challenging to reverse. That makes RSA a secure encryption algorithm that’s practically impossible to brute-force.

How does RSA encryption work?

RSA is a type of asymmetric cryptography (public-key encryption) requiring the use of public and private keys.

  • You need a public key to encrypt the message – to turn the plain text message into a ciphertext. The public keys can be shared and accessed openly.
  • You need a private key to decrypt the encrypted message – to turn the ciphertext back into a plain text message. You must keep your private key secret at all times.
Infographic: Public-key encryption explained
Bob uses the public key to encrypt the plain text message, while Alice uses her private key to decrypt the ciphertext.

Symmetric encryption (like AES and Twofish), on the other hand, uses the same private key to encrypt and decrypt the message. It works well when there’s a chance to share the private key with the recipient of the message securely beforehand. Public-key cryptography, including RSA, is excellent when such an opportunity is unavailable.

Asymmetric encryption algorithms involve four parts: the generation of public and private keys, (public) key exchange (via key exchange algorithm), encryption, and decryption.

Key generation

Key generation is the procedure of calculating the RSA keys – a private and public key pair. The process consists of the following steps:

1. Choosing two prime numbers (p and q)

For encryption to be secure, the chosen prime numbers must be distinct and large.

For example, 2048-bit RSA encryption uses prime numbers that are 308 digits in size. Since coming up with such large numbers is not easy, a primality test opens in a new tab is used for their generation.

2. Calculating the modulus (n)

The first half of your private and public key is the modulus (n) – the product of p and q:

n = p x q

While it’s easy to calculate, it needs to be practically impossible to estimate which numbers were multiplied to get the product.

For example, if your p is 6,637 and q is 8,971, the calculator app on your phone will tell you that the product is 59,540,527. But if you see 59,540,527 in front of you, can you tell or use the same calculator to determine which exact numbers were multiplied to get the product?

Probably not. And that’s the idea behind RSA encryption – the algorithm needs to be simple to compute but not feasible to reverse.

The numbers from the example above would be easy to decompose for a factoring calculator. However, as mentioned, RSA encryption uses prime numbers, 308 digits in size, which are a lot bigger and more difficult to compute.

3. Generating the public key (e)

The RSA public key consists of the modulus (n) and the public exponent (e). Before you can get e – the second half of your public key, you need to calculate φ – the totient for n:

φ (n) = (p − 1) x (q − 1)

Then you can choose e – an arbitrary integer higher than 1 but lower than and relatively prime to φ. Usually, 65,537 is used as e in the RSA encryption.

4. Generating the private key (d)

The RSA private key consists of the modulus (n) and the private exponent (d). d is calculated from p and q and involves finding these numbers’ greatest common divisor (GCD). This procedure is called an Euclidean algorithm, and it’s easier to leave it to online calculators opens in a new tab.

Key distribution

If someone wants to use RSA to encrypt the message for you, they need to know your public key. You can share the public key in any reliable way; it doesn’t necessarily have to be a secret route.

Encryption

Let’s say the person on the other end got your public key (e and n) and wants to send you a message (M). What happens next?

To turn that plain text message into a cipher text (C), they need the following function:

C = Mᵉ mod n

Mod stands for modulo operation and refers to the remainder left after one side is divided by the other, e.g., 11 mod 3 = 2 (3 fits within 11 three times, and 2 is left).

If the message you want to send is a number, you replace the M with your number, and the function has all the missing pieces. If it’s a text message, you’d need to convert the text to the numbers first. For example, using the ASCII alphabet opens in a new tab, the message “NORDVPN” would be “78798268868078” in numbers.

Decryption

To decrypt the ciphertext you receive, you will need to dig up your private key (d and n) from the secret location, take the received cipher text (C), and use the following function:

M = Cᵈ mod n

It will convert the cipher text back to the original message.

Infographic: RSA encryption process explained
Bob generates his public and private key pair. Alice uses Bob’s public key to encrypt a message. Bob uses his RSA private key to decrypt the ciphertext so that he can read the message.

Where is RSA encryption used?

As public-key cryptography, RSA comes in handy when you send information securely to people or servers you haven’t had any contact with before and, thus, don’t have the private keys for symmetric encryption. So you can find it in browsers, email providers, chat applications, cloud services, VPNs, P2P systems, and other communications channels.

However, as far as digital encryption goes, RSA is ancient now, so it’s usually used together with other encryption schemes. A basic example would be using RSA to encrypt the private key for symmetric encryption – to share the key securely while protecting the actual sensitive data with symmetric encryption.

The main RSA uses include establishing a secure connection and creating digital signatures. RSA is not used for encrypting messages or files because other encryption systems are more secure, faster, and require fewer resources.

Establishing a secure connection

Web browsers can use RSA to verify website identities when establishing secure internet connections. These connections use TLS to help prevent sniffing and man-in-the-middle attacks. While older TLS connections could use RSA to exchange encryption keys, TLS 1.3 no longer supports RSA key exchange. RSA is still available in cryptographic libraries such as OpenSSL.

OpenVPN can use RSA certificates to authenticate the VPN server when the VPN client establishes a secure VPN connection. However, VPNs use symmetric encryption algorithms to protect the actual data. For example, NordVPN's OpenVPN protocol uses AES-256-GCM for VPN encryption.

RSA was also the first algorithm used in PGP encryption to encrypt session keys.

Creating digital signatures

You can use the private key to sign your message or document, while the other party can use the public key to verify the authenticity of that message or document.

It’s a versatile function, so when it comes to digital signatures, RSA can be used everywhere, from email to banking to online shopping.

For example, emails are often digitally signed using PGP encryption which uses the RSA algorithm for digital signature creation.

Pros and cons of RSA encryption

The RSA cryptosystem has advantages and disadvantages that you should consider before implementing RSA encryption.

  • RSA algorithm is easy to implement and understand. The algorithm is pretty basic, and the functions are not too complicated compared to other algorithms, such as elliptic curve cryptography and its most popular algorithm – ECDSA. Choosing between RSA and ECDSA, many services are shifting to ECDSA because it’s more efficient in terms of resources management.

  • RSA encryption is pretty versatile, so it can (and is) widely used.

  • When implemented correctly, RSA encryption is impossible to brute-force, at least with current computing capabilities.

  • When implemented incorrectly, RSA is vulnerable to many different attacks.

  • RSA key length is crucial for encryption security, but longer keys require a lot of computing power to generate, so they are not always sustainable.

  • The decryption also takes long and requires a lot of resources.

  • The increasing number of available RSA public keys makes it easier for attackers to devise ways to break or overcome the encryption.

RSA algorithm vulnerabilities

RSA security heavily depends on its implementation. Each part of the process may involve vulnerabilities that impact the outcome of encryption.

Weak random number generators

The RSA algorithm starts with choosing the prime numbers, and this first step may be the vulnerable part. If the prime numbers are not random enough, it’s easier to factor the modulus and crack the encryption.

Weak random number generators are usually at fault here, so you can avoid the vulnerability using pseudo-random number generators instead.

Faulty key generation

Prime numbers may be random enough but too small or close to each other. And that’s another problem.

Since the RSA algorithm uses a public key for encryption, the key size is critical to prevent factoring. Uncovering prime numbers (p and q) is easier when the numbers are smaller. And if the numbers are too close to each other, then the private key (d) ends up being relatively small.

That’s why security experts recommend the minimum key size of 2048-bit, while newer RSA keys usually go for 4096-bit.

Attacks on RSA encryption

Ignorance of the mentioned RSA vulnerabilities leads to easy RSA attacks.

Factorization attack

If you don’t address the vulnerabilities, cybercriminals can take advantage of them to perpetrate factorization attacks.

RSA encryption is only secure if no one can discover the prime numbers p and q from their product n. However, if the prime numbers are too close to each other or are not random and big enough, attackers can factor them, and then it takes little to expose the private key.

Side-channel attack

In side-channel attacks, attackers analyze the extra information gathered about the decryption process instead of cracking the encryption key. For example, they examine how much power the algorithm uses, or even the sounds computers make during it.

A timing attack is also an example of side-channel attacks. In RSA timing attacks, the attackers analyze how long decryption takes for different known ciphertexts to deduce the private key (d).

Plaintext attack

If the attacker matches any part of a plaintext message to the cipher text, they can carry on plaintext attacks:

  • Short message attack. An attacker has access to some parts of the plaintext message and encrypts it to get ciphertext. They can then use it to deduce other parts of the plaintext message. You can avoid this plaintext attack by using paddling – including extra data in the plaintext message before encrypting it.
  • Cycling attack. An attacker tests permutation operations that could have been done to create the ciphertext. If it works, they can then reverse the process to obtain the plaintext message from the ciphertext.
  • Unconcealed message attack. It’s rare, but in theory, some encrypted ciphertext can be identical to the original plaintext message. If that happens, attackers can deduce other parts of the encrypted message and carry unconcealed message attacks.

Chosen cipher attack

As mentioned before, you use the Euclidean algorithm to generate the private key. As the algorithm is no secret, attackers can use the extended Euclidean algorithm to get the plain text message from the ciphertext. That’s how you get chosen cipher attacks.

Is RSA encryption secure?

RSA encryption remains secure against publicly known attacks using conventional computers when implemented correctly, with sufficiently large keys and modern padding methods. However, poor implementation can introduce vulnerabilities that attackers can exploit.

In 2012, researchers found that approximately 0.2% of the RSA moduli they collected shared a prime factor with another key, allowing them to recover the corresponding private keys.1

In 2019, researchers from Keyfactor analyzed 75 million RSA certificates collected from the internet and found that one in every 172 was vulnerable to factoring attacks because of shared prime factors.2

These findings highlight the importance of generating RSA keys securely rather than indicating a fundamental flaw in the algorithm itself.

While properly generated RSA keys of 2048 bits or more remain secure against publicly known factoring attacks, emerging technologies could change that. Quantum computing presents a known long-term threat, while recent rumors suggest that AI could help researchers discover new ways to break RSA encryption.

Can AI break RSA encryption? What we know about the rumors

Recent rumors about AI labs discovering a faster factoring algorithm have raised an important question: Is RSA encryption broken? As of November 27, 2026, no AI system has publicly demonstrated a practical way to break properly generated 2048-bit or larger RSA keys.

RSA's security relies on how difficult it is to recover two large prime numbers from their product, which forms part of the public key. This process is known as factoring.

Quantum computers could eventually break RSA using a mathematical method known as Shor's algorithm, but sufficiently powerful quantum computers don't exist yet. The recent AI rumors concern a different possibility: discovering a much faster factoring method that works on conventional computers.

However, not everything being discussed online is backed by research. Let's look at what researchers have actually achieved and what remains speculation.

What has actually been said

On November 24, 2026, computer scientist Scott Aaronson wrote in a comment on his personal blog that he had heard “many, many rumors” about AI labs potentially discovering an efficient factoring algorithm.3

The comment sparked widespread discussion on Reddit and other social media platforms, with publications such as Nature and ForkLog subsequently covering the rumors.

Aaronson later crossed out his original comment and clarified that “a rumor is a rumor is a rumor.” While he believes AI labs may have made significant discoveries in cryptography, he has not confirmed that they have found a way to break RSA.

Meanwhile, several recent developments show how AI is already helping researchers tackle the factoring problem:

  • September 9, 2026. Cognition researcher Eric Lu reported that he had factored RSA-260, an 862-bit challenge number, with help from the AI coding agent Devin.4
  • September 19, 2026. Researcher Stephen Weis factored a larger, 896-bit number known as RSA-896 with help from Anthropic's Claude.5
  • November 25, 2026. Google Research released an AI-generated research paper proposing a factoring algorithm with mathematically proven limits on its running time. While the paper claims a theoretical breakthrough, it does not demonstrate a faster practical way to factor large RSA keys.6

These developments demonstrate AI's growing role in cryptographic research, but none establishes that properly generated RSA-2048 keys can be broken.

What remains speculation

Despite recent advances in AI-assisted factoring, several questions remain unanswered:

  • Has any AI lab discovered a significantly faster factoring algorithm?
  • How long would such a method take to break an RSA key?
  • Which RSA key sizes could be at risk?
  • Are any AI companies keeping major cryptographic discoveries private?

To prove that RSA encryption has been broken, researchers would need to demonstrate that their method can factor numbers used in modern RSA keys within a realistic amount of time. Other researchers would also need to be able to verify the results.

AI has already helped researchers make existing factoring methods more efficient. One example is the general number field sieve (GNFS), the leading known method for factoring large numbers on conventional computers. However, no publicly demonstrated AI breakthrough has made it practical to break properly generated 2048-bit RSA keys.

What a practical factoring break would and wouldn’t affect

If AI discovered a way to break modern RSA encryption, it could put website security, software updates, and some encrypted communications at risk. However, it wouldn't mean that all encryption is suddenly broken.

Many modern security protocols already use alternatives to RSA. The consequences would depend on how each technology uses RSA to protect your data or verify identities.

Area

Possible impact

Directly affected?

TLS certificates

Attackers could forge digital signatures to impersonate legitimate websites.

Yes, where vulnerable RSA keys are used

Code signing

Malicious software or updates could pass signature verification and appear to come from trusted developers.

Yes, if RSA-signed

Stored RSA-encrypted data

Previously encrypted information or encryption keys protected by RSA could be recovered.

Yes

TLS 1.3 sessions

Attackers could impersonate websites that use RSA for authentication, but past sessions using forward secrecy would remain protected against RSA factoring alone.

Partially

AES-encrypted data

AES itself would remain unaffected, but data could be exposed if RSA was used to protect its encryption keys.

Not directly

Elliptic curve cryptography (ECC)

ECC relies on a different mathematical problem.

Not automatically

Post-quantum algorithms

These algorithms rely on mathematical problems other than integer factoring.

Not directly

A breakthrough could also put some of your previously encrypted communications at risk. This threat is known as a “harvest now, decrypt later” attack, where attackers collect encrypted data today in the hope of decrypting it in the future.

For example, attackers could potentially decrypt recorded traffic from older TLS 1.2 connections that used RSA to exchange encryption keys. However, connections that use temporary, independent keys provide forward secrecy, which helps protect past communications even if long-term authentication keys are later compromised.

Breaking RSA would not automatically compromise elliptic curve cryptography (ECC), which uses a different mathematical problem to protect data and verify identities. However, sufficiently powerful quantum computers could threaten both RSA and ECC, which is why the industry is already moving toward post-quantum cryptography.

The future of RSA: ECC and post-quantum cryptography

Although RSA encryption remains widely used, its performance limitations and emerging security threats are encouraging the cybersecurity industry to adopt alternative cryptographic methods.

One alternative is elliptic curve cryptography (ECC), which offers comparable security to RSA while using considerably smaller keys. This makes ECC a more efficient choice for many applications, including digital signatures and secure internet connections.

However, switching from RSA to ECC doesn't eliminate every threat. While the recent AI factoring rumors remain unconfirmed, sufficiently powerful quantum computers could eventually break both RSA and ECC.

To address this threat, the US National Institute of Standards and Technology (NIST) finalized three post-quantum cryptography standards in 2024: ML-KEM (FIPS 203) for establishing encryption keys, and ML-DSA (FIPS 204) and SLH-DSA (FIPS 205) for digital signatures.7

In October 2026, NIST published its final transition guidelines, outlining plans to discourage the use of quantum-vulnerable public-key algorithms, including RSA and ECC, after 2030 and disallow their use under NIST standards and guidelines after 2035.8 These timelines do not constitute a worldwide ban on RSA encryption.

ECC offers an efficient alternative to RSA for many applications today, while post-quantum algorithms offer a long-term solution to quantum computing threats. Some web browsers and content delivery networks are already combining traditional and post-quantum methods to establish secure connections.

NordVPN is one example of a VPN provider preparing for this shift. NordVPN has introduced post-quantum encryption in its apps to help protect your online communications against future quantum computing threats, including “harvest now, decrypt later” attacks.

Online security starts with a click.

Stay safe with the world’s leading VPN

FAQ


References

1 Lenstra, A. K., Hughes, J. P., Augier, M., Bos, J. W., Kleinjung, T., & Wachter, C. (2012). Ron was wrong, Whit is right. Cryptology ePrint Archive. https://eprint.iacr.org/2012/064 opens in a new tab 

2 Kilgallin, J., & Vasko, R. (2019). Factoring RSA keys in the IoT era. IEEE. https://www.keyfactor.com/wp-content/uploads/Factoring-RSA-Keys-in-the-IoT-Era-JD-Kilgallin-Keyfactor-IEEE-Conference.pdf opens in a new tab 

3 Aaronson, S. (2026). I’ve been drinking wine in my kitchen (comment 23). Shtetl-Optimized. https://scottaaronson.blog/?p=10362 opens in a new tab 

4 Lu, E. (2026). Factoring RSA-260. Cognition. https://cognition.com/blog/factoring-rsa-260 opens in a new tab 

5 Weis, S. A. (2026). RSA-896. Stephen A. Weis. https://saweis.net/posts/rsa-896.html opens in a new tab

6 Cogentic. (2026). Unconditional Integer Factorization in Time LN[1/3, O(1)]. Google Research. https://github.com/google-research/google-research/tree/master/cogentic_research_papers/integer_factorization opens in a new tab 

7 National Institute of Standards and Technology. (2024). Announcing approval of three Federal Information Processing Standards (FIPS) for post-quantum cryptography. NIST. https://csrc.nist.gov/news/2024/postquantum-cryptography-fips-approved opens in a new tab 

8 Moody, D., Perlner, R., Regenscheid, A., Robinson, A., & Cooper, D. (2026). Transition to post-quantum cryptography standards. NIST. https://doi.org/10.6028/NIST.IR.8547 opens in a new tab

Also available in: Dansk , English , Suomi , ‪한국어‬ , Svenska , 繁體中文 (台灣) .

Blog author Domantas Lapinskas

Domantas Lapinskas

Domantas writes about cybersecurity, privacy, and the strange little ways the internet gets people into trouble. He offers clear, practical advice for staying safe online that is easier to remember than another complicated password.