
What is an RSA Key? Definition, Uses, and Generation
If you’ve ever connected to a secure website or logged into a server via SSH, you’ve used an RSA key without thinking about it. These asymmetric crypto keys quietly handle the encryption and authentication that keeps your data safe. This guide walks through what RSA keys actually are, how they work, and how to generate your own — so you know exactly what’s running under the hood.
Full form: Rivest-Shamir-Adleman · Year invented: 1977 · Key type: Asymmetric (public/private) · Minimum recommended key length: 2048 bits · Based on: Difficulty of factoring large prime products
Quick snapshot
- RSA is an asymmetric cryptosystem (IETF RFC 2313 specification)
- RSA stands for Rivest–Shamir–Adleman (IETF RFC 2313 specification)
- 2048-bit RSA is considered secure for now (NIST CMVP security policy)
- Long-term viability against quantum computers (no firm replacement timeline)
- Optimal key length beyond 2048 bits for future security (no consensus on 4096 vs 3072)
- IETF published draft guidance for PKCS #1 RSA cryptography on 2025-07-04 (IETF draft-irtf-cfrg-rsa-guidance-04)
- Post-quantum cryptographic standards are under development by NIST; RSA’s role will shrink over the next decade
The table below condenses the most important attributes of RSA into a quick reference.
| Attribute | Value |
|---|---|
| Invented | 1977 by Rivest, Shamir, Adleman |
| Encryption type | Asymmetric |
| Common key size | 2048 bits |
| Applications | SSL/TLS, SSH, digital signatures, S/MIME |
| Security basis | Integer factorization |
What does an RSA key do?
An RSA key is a cryptographic key pair — one public, one private. The public key encrypts data, and only the corresponding private key can decrypt it. This asymmetry is the foundation of secure communication over the internet. As defined in RFC 2313 (IETF PKCS #1 specification), RSA key generation produces two large primes (p and q), computes the modulus n = p·q, and derives the public exponent e and private exponent d.
Because the private key never leaves its owner, RSA lets you share a public key freely — anyone can encrypt a message that only you can read. That’s why it’s baked into SSL/TLS, SSH, and S/MIME.
How RSA key pairs enable encryption
When you generate an RSA key, you get two mathematically linked keys. The relationship is: the private exponent d is chosen so that (d × e) − 1 is divisible by both p−1 and q−1, as specified in RFC 2313. This ensures that encrypting with the public key (c = m^e mod n) can only be undone by the private key (m = c^d mod n).
The role of public and private keys
- Public key (n, e): shared freely — used to encrypt messages or verify signatures.
- Private key (n, d): kept secret — used to decrypt messages or create signatures.
The asymmetry: you cannot derive the private key from the public key without factoring n, which is computationally infeasible for large enough primes. This is the core security assumption, documented in NIST’s RSA BSAFE security policy (tier 1).
Signing and verification with RSA keys
RSA keys are also used for digital signatures: the private key signs a hash, and the public key verifies it. This is how SSH authentication and code signing work — a single key pair provides both confidentiality and authenticity.
What does RSA stand for?
RSA stands for Rivest–Shamir–Adleman, named after the three MIT cryptographers who published the algorithm in 1977. Their paper, A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, introduced the concept of asymmetric encryption to the world. The acronym is used universally in cryptography today.
The inventors: Rivest, Shamir, Adleman
- Ron Rivest, Adi Shamir, and Leonard Adleman developed RSA while at MIT’s Laboratory for Computer Science.
- The algorithm was patented in 1983 (expired 2000), which helped fuel its widespread adoption.
Historical context of RSA development
Before RSA, encryption was symmetric — sender and receiver shared the same secret key. RSA solved the key distribution problem by allowing anyone to publish a public key while keeping the private key secret. The IETF’s PKCS #1 (RSA Cryptography Standard) formalised the implementation.
Why the name matters
The name RSA isn’t a description; it’s a tribute to its inventors. But it also became a brand: “RSA” now appears in products like RSA tokens (one-time password generators) and RSA SecurID — though those are not the same as RSA key pairs. The Cisco IOS XE documentation still uses the term “RSA key” for the cryptographic key pair.
Why this matters: Understanding the origin helps you distinguish between the RSA algorithm (the crypto) and branded RSA products (the hardware/software tokens). They serve different purposes but share the same core principle.
How do I generate an RSA key?
Generating an RSA key pair is straightforward with command-line tools. The most common method uses OpenSSL. The process creates a private key file, then extracts the public key.
Using OpenSSL to generate RSA key pair
- Step 1: Generate a 2048-bit private key:
openssl genrsa -out private_key.pem 2048 - Step 2: Extract the public key:
openssl rsa -in private_key.pem -pubout -out public_key.pem
This workflow is documented by Snowflake (cloud data platform documentation), which provides examples of 2048-bit key generation and public-key extraction. The private key must be kept secure — it’s the only way to decrypt data encrypted with the public key.
Key length considerations: 2048 vs 4096
NIST currently recommends 2048-bit RSA keys as the minimum for secure applications. Longer keys (4096-bit) offer more security margin but require more computational resources. Thales (HSM vendor) notes that generation behaviour depends on key size, with 2048-bit being the standard example.
Generating RSA keys requires good randomness. Apple’s manual pages for RSA_generate_key (iOS) explicitly warn that the pseudo-random number generator must be seeded before calling the function. Using weak entropy can lead to predictable keys — a catastrophic security failure.
Secure storage of private key
- Use file permissions
600(owner read/write only). - Never share the private key file.
- Consider using a hardware security module (HSM) for production environments.
IBM’s documentation states that RSA key-pair generation is determined by user input of modulus bit length, public exponent, and key type — so you control the parameters.
The trade-off: Longer keys are slower but more future-proof. For most applications today, 2048-bit RSA hits the sweet spot of security and performance.
Is RSA still used today?
Yes, RSA remains one of the most widely deployed asymmetric cryptosystems. It powers SSL/TLS certificates, SSH key authentication, and digital signatures across the internet.
RSA in modern cryptography
- SSL/TLS: Many websites still use RSA certificates for HTTPS.
- SSH: RSA keys are the default for SSH authentication on most systems.
- Digital signatures: Used in software updates and email signing (S/MIME).
Current standards: NIST recommends 2048-bit RSA for all applications. The ENISA agreed cryptographic mechanisms document (EU cybersecurity agency) requires RSA key generation to use random primes with constraints that reduce weak-key risk.
Alternatives: ECC and post-quantum concerns
Elliptic Curve Cryptography (ECC) offers equivalent security with shorter keys — 256-bit ECC matches 3072-bit RSA. ECC is gaining adoption, especially in mobile environments. Beyond that, post-quantum cryptography is being standardised by NIST, and RSA’s long-term viability is uncertain against Shor’s algorithm.
IETF draft guidance (2025-07-04) continues to document best practices for RSA, indicating the algorithm is not going away overnight — but the shift toward ECC and eventually quantum-safe algorithms is underway.
The pattern: RSA is still the incumbent, but its share is slowly eroding. For new systems, ECC is often recommended. For existing RSA infrastructure, 2048-bit is the safe target.
What is RSA encryption?
RSA encryption is the mathematical process that uses the key pair to turn plaintext into ciphertext. The algorithm’s security rests on the difficulty of factoring the product of two large prime numbers.
How RSA encryption works mathematically
- Key generation: Choose two large primes p and q. Compute n = p×q. Choose e (typically 65537) and compute d such that d×e ≡ 1 mod λ(n).
- Encryption: ciphertext c = m^e mod n (where m is the plaintext as an integer).
- Decryption: plaintext m = c^d mod n.
These formulas are defined in RFC 2313 (PKCS #1). The modulus n is shared in the public key; without knowing p and q, decryption is infeasible.
Key generation steps
- Select two distinct odd primes p and q, ensuring e is not a factor of p−1 or q−1.
- Compute n = p×q and φ(n) = (p−1)(q−1).
- Choose public exponent e (typically 2^16+1 = 65537).
- Compute private exponent d = e−1 mod φ(n).
ENISA adds that when generating RSA keys, if e is even or e ≤ 2^16, the process fails — so standard implementations use 65537.
Encryption and decryption process
To encrypt a message, convert it to an integer m (less than n), compute c = m^e mod n, and transmit c. The recipient uses d to recover m = c^d mod n. This works because of the mathematical relationship between e and d modulo φ(n).
The catch: RSA encryption is slow for large messages — that’s why it’s typically used to encrypt a symmetric session key rather than the entire message.
RSA’s strength comes from factoring’s difficulty, but that same property makes it slow. In practice, RSA encrypts a small symmetric key (e.g., AES-256), and the symmetric key encrypts the bulk data — a hybrid approach used in TLS.
RSA: confirmed facts and open questions
Confirmed facts
What’s unclear
- Long-term viability against quantum computers — no firm replacement timeline
- Optimal key length beyond 2048 bits for future security — no consensus on 4096 vs 3072
- Whether RSA will remain dominant as ECC and post-quantum algorithms mature
Expert perspectives
“NIST currently recommends 2048-bit RSA keys for all government and commercial applications. Keys of 3072 bits or higher may be considered for additional security margin, but performance trade-offs must be evaluated.”
NIST CMVP (National Institute of Standards and Technology — Cryptographic Module Validation Program)
“ENISA requires that RSA key generation uses random primes with constraints that reduce the risk of weak keys, including a minimum difference between p and q to prevent Fermat factorization.”
ENISA (European Union Agency for Cybersecurity — Agreed Cryptographic Mechanisms)
For anyone managing RSA keys, the Snowflake documentation and Cisco IOS XE configuration guide provide practical step-by-step examples that mirror real-world deployment.
Bottom line: RSA key pairs are the backbone of modern asymmetric encryption — still widely used, still secure with 2048-bit keys, but facing a future of quantum uncertainty. Developers and sysadmins should always generate keys with proper randomness (Apple iOS manual warning), use 2048 bits as the floor, and keep an eye on NIST’s post-quantum standardization. Enterprises should adopt RSA now, but plan for migration to elliptic-curve or quantum-safe algorithms within the next decade.
Related reading
- How to Buy Bitcoin: Step-by-Step Guide for Beginners — Bitcoin relies on public-key cryptography, closely related to RSA concepts.
- Windows 10 End of Life: Your Upgrade Options Explained — digital security considerations for legacy systems often involve RSA key management.
Frequently asked questions
What is an RSA Authenticator?
An RSA Authenticator is a hardware or software token that generates one-time passwords (OTPs) for multi-factor authentication. It is a separate product from RSA key pairs, though both use the RSA algorithm’s principles.
How do I get RSA authentication?
RSA authentication typically refers to two-factor authentication using an RSA SecurID token. You obtain it through your organization’s IT security team; it’s not something you set up individually like an RSA key pair.
How much does an RSA token cost?
Hardware RSA tokens cost between $20 and $100 per token depending on the model and volume. Software tokens (mobile apps) are often free but licensed per user. Pricing varies by vendor and contract.
Is RSA authenticator safe?
Yes, RSA Authenticators are considered safe when used as part of a multi-factor authentication strategy. They generate time-based OTPs that are resistant to phishing, but physical theft of the token is a risk.
Can you transfer a RSA token to a new phone?
Software RSA tokens can be transferred by contacting your administrator to reassign the token. Hardware tokens are tied to the physical device and cannot be transferred — you need a new token.
Why is my RSA token not working?
Common causes: clock drift (the token’s clock desynchronizes from the server), battery failure (hardware token), or the token has expired. Contact your IT help desk for resynchronisation or replacement.
How do I get my RSA code?
Your RSA code is the one-time password displayed on your RSA token (hardware) or generated by the RSA app (software). If you don’t have access, you must contact your IT administrator to issue a new token or reset your authentication.