RSA is a way to lock data with a public key so only the matching private key can unlock it.
This guide is for students and anyone who has seen "RSA" on a certificate or in a settings screen and wants to know what it means. You do not need advanced maths. A tiny worked example with small numbers shows the idea.
In short
- RSA uses two linked keys: a public key that anyone can use to lock, and a private key that only the owner uses to unlock.
- Its safety rests on one hard problem: splitting a huge number back into the two prime numbers that made it.
- Key length matters. US government rules treat keys shorter than 2048 bits as too weak for new use.
- Large future quantum computers are expected to break RSA, so organisations are planning a move to new methods.
What you will learn
- Explain the difference between an RSA public key and private key.
- Follow a small-number example of RSA from start to finish.
- Explain why key length matters.
- Describe why quantum computers are a concern for RSA.
- Lock anyone can use (public key)
- the half of the key pair you can share openly.
- Key only you hold (private key)
- the half you keep secret, which unlocks what the public key locked.
- Number with no smaller factors (prime)
- a whole number that only divides by 1 and itself, such as 3, 7 or 11.
What is RSA encryption?
Think of a padlock you hand out, while you keep the only key. Anyone can snap the padlock shut on a box. Only you can open it again.
RSA works the same way. It is a kind of public key encryption, where one key locks and a different, matching key unlocks. It is named after its three inventors, Rivest, Shamir and Adleman, who described it in 1977 [1]. Their paper also showed how the same keys can create digital signatures (proof that a message came from the key's owner) [1].
The public key is a pair of numbers. One of them is a very large number made by multiplying two secret primes [2]. The inventors wrote that the safety of the method rests on how hard it is to split that number back into its primes [1].
Where the comparison stops working: a padlock is a physical object. An RSA key is just a number. It can be copied without anyone noticing, so the private key must be stored with great care.
New to the idea of two keys? Start with Public Key Cryptography for Beginners. This page looks at RSA itself.
Why does it matter?
RSA has been used for decades, so it sits inside many systems people rely on. Knowing its limits helps you spot weak or ageing set-ups.
If you are a student
What could happen: you learn the steps by rote but cannot explain why the method is safe.
Check this: work through the small-number example on this page by hand.
Next: Encryption for Beginners
If you are new to IT work
What could happen: an old system still uses short RSA keys that are no longer thought safe.
Check this: look at the key length on certificates and keys you look after.
If you plan for the long term
What could happen: data locked with RSA today is copied now and unlocked years later by a quantum computer.
Check this: ask which systems rely on RSA and how long their data must stay secret.
What does it look like?
Here is a made-up key card using tiny numbers, so you can follow every step by hand.
Example only. All values are made up.
EXAMPLE toy RSA key (far too small for real use) Secret primes: p = 3, q = 11 (1) Public number: n = 3 x 11 = 33 (2) Public key: e = 3, n = 33 (3) Private key: d = 7 (4) Message: 4 -> locked: 31 -> unlocked: 4 (5)
- Two primes, chosen at random and kept secret.
- Multiply them. This number goes into both keys.
- The public key. Anyone may use it to lock a message.
- In a real file, this line would contain a secret number hundreds of digits long.
- The message 4 is locked to 31, then unlocked to 4 again.
Why this is risky: anyone can split 33 into 3 and 11 in their head. Then they can work out the private key.
The safer way: real keys use huge primes. Splitting the public number is then not practical with today's computers.
How does it work?
- Pick two secret primes and multiply them. Here, 3 times 11 gives 33. This is the public number [2].
- Choose the locking number. Here it is 3. Together with 33, it makes the public key [2].
- Work out the unlocking number. Using the secret primes, the owner finds a matching number, here 7. This is the private key. Without the primes, it is very hard to find [1].
- Lock the message. Multiply the message by itself 3 times, then keep the remainder after dividing by 33. So 4 x 4 x 4 is 64, and 64 leaves 31. The locked message is 31 [2].
- Unlock it. Multiply 31 by itself 7 times, then keep the remainder after dividing by 33. The answer is 4, the original message [2].

"Keep the remainder" is called modular arithmetic, the same sum a clock does when 13:00 becomes 1 o'clock. Real RSA also adds random padding to each message before locking it [2]. The practitioner guide covers this.
Why key length matters
Key length is the size of the public number, counted in bits (binary digits). A longer key means bigger primes, which are much harder to find by splitting. US government rules treat RSA keys shorter than 2048 bits as not allowed for key exchange, and 2048 bits as acceptable [3]. The same document estimates a 2048-bit key gives about 112 bits of strength [3].
Why quantum computers matter
RSA is a public key method built on splitting numbers. The UK cyber agency expects most such methods to be broken by a large enough quantum computer [4]. It also warns that attackers could copy locked data today and unlock it later [4]. It asks organisations to finish moving to new, quantum-safe methods by 2035 [5]. The US standards body has published its own plan for this move [6].
A worked example
Dario Oakley is studying for a computing exam. His textbook explains RSA in one dense page of symbols. He decides to try it with pencil and paper.
He picks the primes 5 and 11, which multiply to 55. He looks up how to find a matching pair of locking and unlocking numbers. With the locking number 3, the unlocking number turns out to be 27.
He locks the message 2. Two times two times two is 8. Divided by 55, the remainder is still 8, so the locked message is 8. Unlocking means multiplying 8 by itself 27 times and keeping the remainder. He uses a calculator that handles remainders, and gets 2 back. The idea clicks.
Then his friend asks, "So what stops me working out your 27?" Dario sees the answer. Anyone who knows 55 can quickly find 5 and 11, and then repeat his own steps to get 27.
That is the whole point of key length. With real keys, the public number is hundreds of digits long. Finding its two primes is not practical with today's computers, so the private number stays safe.
In his exam, Dario explains RSA in three lines: two keys, one hard problem, and why size matters. He adds one more line: quantum computers are expected to make that hard problem easy, which is why the move to new methods has begun.
Myths and mistakes
| What people think | What is true |
|---|---|
| The public key must be kept secret. | The public key is meant to be shared. Only the private key must stay secret. |
| RSA is unbreakable. | It relies on splitting huge numbers being hard. Short keys and future quantum computers both weaken that [3][4]. |
| Any key length is fine. | Keys under 2048 bits are not allowed for key exchange under US government rules [3]. |
| Quantum computers are a problem only for the future. | Data copied today could be unlocked later, so planning starts now [4]. |
What can I do this week?
- Work through the small-number example by hand.
- Open a website's certificate details in your browser and look for the key type and size.
- List the keys and certificates you look after, with their key lengths.
- Flag any RSA key shorter than 2048 bits for replacement.
- Ask who in your organisation is planning the move to quantum-safe methods.
Checklist
- I can explain the difference between a public key and a private key.
- I can explain why splitting a large number into primes is the hard problem.
- Private keys I look after are stored safely, with a named owner.
- No RSA key I look after is shorter than 2048 bits.
- I know which systems rely on RSA.
- Someone owns our plan for quantum-safe methods.
Common questions
What does RSA stand for?
It stands for the surnames of its three inventors: Rivest, Shamir and Adleman. They described the method in a 1977 paper on public key encryption and digital signatures. The name is not an abbreviation of what it does.
Is RSA still safe to use?
Mostly yes, for now, with long enough keys and modern settings. US government rules accept 2048-bit keys and reject shorter ones for key exchange. Because quantum computers are expected to break RSA, government agencies are asking organisations to plan a move to new methods.
What is the difference between RSA and AES?
They use keys differently. RSA uses two different keys, one to lock and one to unlock. AES uses one shared key for both jobs. Both sides must already hold that AES key, which is why two-key methods are useful for setting up a secure link in the first place.
Why are prime numbers used?
Primes make the hard problem work. Multiplying two large primes is quick. Splitting the result back into those two primes is very slow with today's computers. The private key can be worked out from the primes, so keeping them hidden keeps the private key safe.
Do software and servers have RSA keys too?
Yes. Servers, apps and automated tools often hold private keys to prove who they are. Those keys are identities for software, not people, and each needs a named owner, safe storage and a plan for replacing it.
Where next?
Ready for the detail? Read the practitioner guide: RSA Padding Status. It goes further into the padding schemes real RSA uses, which ones are retired, key size rules and dated transition plans.
Also useful:
- Public Key Cryptography for Beginners
- Symmetric vs Asymmetric Encryption
- AES Encryption for Beginners
- Post-Quantum Cryptography Migration Guide
Related NHI Mgmt Group resources: Digital Signatures for Beginners, Quantum Computing and Security for Beginners and Non-Human Identities for Beginners.
Key terms
- RSA
- A public key method whose safety rests on how hard it is to split a huge number into its two primes.
- Public key
- The shareable half of a key pair, used to lock data or check a signature.
- Private key
- The secret half of a key pair, used to unlock data or make a signature.
- Asymmetric encryption
- Encryption that uses one key to lock and a different, matching key to unlock.
- Key length
- The size of a key in bits. Longer keys are generally harder to break.
- Digital signature
- A check, made with a private key, that proves who sent a message and that it was not changed.
- Post-quantum cryptography
- New encryption methods designed to stay safe against large quantum computers.
Sources and further reading
- R.L. Rivest, A. Shamir and L. Adleman, "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems", 1977 (MIT copy). https://people.csail.mit.edu/rivest/Rsapaper.pdf (accessed 3 Dec 2026).
- IETF, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, November 2016. https://www.rfc-editor.org/rfc/rfc8017 (accessed 3 Dec 2026).
- National Institute of Standards and Technology, "Transitioning the Use of Cryptographic Algorithms and Key Lengths", NIST SP 800-131A Rev. 2, March 2019. https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf (accessed 3 Dec 2026).
- National Cyber Security Centre, "Next steps in preparing for post-quantum cryptography", NCSC white paper, updated 14 August 2024. https://www.ncsc.gov.uk/whitepaper/next-steps-preparing-for-post-quantum-cryptography (accessed 3 Dec 2026).
- National Cyber Security Centre, "Timelines for migration to post-quantum cryptography", NCSC, 20 March 2025. https://www.ncsc.gov.uk/guidance/pqc-migration-timelines (accessed 3 Dec 2026).
- National Institute of Standards and Technology, "Transition to Post-Quantum Cryptography Standards", NIST IR 8547 (final), October 2026. https://csrc.nist.gov/pubs/ir/8547/final (accessed 3 Dec 2026).