Machine learningCryptographyPublic-key cryptographyAlgorithm

RSA Cryptosystem

Also known as: RSA encryption, RSA public-key cryptography

OriginatorRonald RivestYear1978Sources2Related methods11

RSA is a foundational public-key cryptosystem developed by Rivest, Shamir, and Adleman in 1978. It enables secure encryption and digital signatures by using a pair of mathematically linked keys: a public key for encryption and a private key for decryption. RSA's security relies on the computational difficulty of factoring large composite numbers into their prime factors.

Key highlights

  • Widely standardized and supported across platforms and libraries
  • Enables both encryption and digital signature generation with the same key pair
  • Mathematically elegant foundation based on the factoring problem
  • Backward compatible with decades of existing infrastructure

Intuition

This section is available to Pro members. Upgrade to Pro

How it works

This section is available to Pro members. Upgrade to Pro

When to use it

RSA is appropriate for encrypting small amounts of data, establishing secure channels, and creating digital signatures. It is commonly used in TLS/SSL protocols, email encryption (PGP), and certificate authorities. RSA requires careful padding schemes (OAEP for encryption, PSS for signatures) to be secure. Modern implementations should use key sizes of at least 2048 bits for reasonable security against current computational power.

Strengths & limitations

Strengths
  • Widely standardized and supported across platforms and libraries
  • Enables both encryption and digital signature generation with the same key pair
  • Mathematically elegant foundation based on the factoring problem
  • Backward compatible with decades of existing infrastructure
Limitations
  • Computationally expensive compared to symmetric encryption; typically used for key exchange rather than bulk data encryption
  • Key size must be large (2048 bits or more) for adequate security, making encryption and decryption slower than symmetric alternatives
  • Vulnerable to quantum computers if they become practical, necessitating post-quantum alternatives

Common pitfalls

This section is available to Pro members. Upgrade to Pro

Applications

This section is available to Pro members. Upgrade to Pro

Frequently asked

Why is RSA slow compared to symmetric encryption like AES?

RSA involves modular exponentiation with very large numbers (2048 bits or larger), which requires orders of magnitude more computation than the efficient byte-level operations of AES. In practice, RSA is used to encrypt a small key that then encrypts the bulk data with AES.

What happens if someone factors my public key modulus n?

If an attacker factors n into its prime factors p and q, they can compute φ(n) and then derive your private key d from your public exponent e. This is why using sufficiently large primes and key sizes is critical.

Can RSA signatures be forged without the private key?

Not with properly padded signatures (PSS). However, unpadded or improperly padded RSA signatures are vulnerable to various mathematical attacks. Always use standard padding schemes.

Is RSA still secure in 2026?

RSA with 2048-bit keys is still considered secure against classical computers, though 4096-bit keys are recommended for long-term security. However, RSA will be vulnerable to quantum computers if they are built at scale, so post-quantum cryptography research is actively underway.

How do I choose appropriate primes p and q?

Use a cryptographically secure random number generator to generate large numbers, then test each for primality using algorithms like the Miller-Rabin test. Modern libraries handle this automatically.

Sources

  1. 1.
    Rivest, R. L., Shamir, A., & Adleman, L. (1978). A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2), 120-126.
  2. 2.
    Koblitz, N. (1987). A Course in Number Theory and Cryptography. Springer-Verlag.
    ISBN 978-0387966618

You have read it. What now?

Cite this page

ScholarGate. (2026, June 3). RSA Cryptosystem. ScholarGate. https://scholargate.app/cryptography/rsa-cryptosystem