RSA: pitfalls to avoid
The most common mistakes developers and administrators make with RSA, from short keys to home-made implementations.
Mistakes made by developers and administrators
- Implementing RSA yourself instead of using well-tested libraries.
- Using RSA without padding or with the old PKCS#1 v1.5 encryption padding instead of OAEP.
- Using outdated schemes for signatures instead of PSS, where possible.
- Generating keys with non-cryptographic random generators or with little entropy, for example on freshly booted devices.
- Using keys shorter than 2048 bits.
- Reusing the same key pair for different purposes, such as encryption and signing.
- Storing the private key unprotected, in plain text on disk or in a code repository.
RSA: frequently asked questions
Short answers to the most common doubts about RSA, keys, security and quantum computers.
The pages of this topic
Back to the overviewRSA: how it works
Key generation, encryption, decryption and signing with RSA, explained step by step without complicated formulas.
RSA: history
From Diffie and Hellman’s 1976 revolution to the invention of RSA, from the patent to the discovery of the secret British precedent.
RSA: the maths
The formulas of RSA — modulus, Euler’s function, exponents, encryption and decryption — and the factoring problem on which security rests.
RSA: worked example
A complete RSA example with small numbers, from choosing the primes to encrypting and decrypting a number.
RSA: weaknesses and attacks
Known attacks on RSA: keys that are too short, faulty random numbers, vulnerable padding, timing attacks and the threat of quantum computers.
RSA today
Where RSA is still used — certificates, digital signatures, email and code — and why it is giving way to elliptic curves and post-quantum algorithms.