Public Key
The public key can be distributed to others. It is used in RSA encryption to protect information intended for the owner of the corresponding private key.
RSA is a widely recognized public-key cryptographic algorithm used to protect information and verify digital identities. It uses two mathematically connected keys: a public key that can be shared and a private key that must remain secret.
Explore How RSA WorksRSA stands for Rivest–Shamir–Adleman, the surnames of its three inventors. Introduced in 1977, RSA uses mathematical relationships between large prime numbers to create a public and private key pair.
The public key can be distributed to others. It is used in RSA encryption to protect information intended for the owner of the corresponding private key.
The private key must be protected. It is used to decrypt information encrypted with the corresponding public key and to create digital signatures.
RSA relies on the computational difficulty of factoring the product of two sufficiently large prime numbers.
RSA uses a mathematically related pair of keys. The public key is shared, while the private key stays under the control of its owner.
Two large prime numbers are selected and used to calculate the RSA key pair.
The public key is made available to anyone who needs to send protected information or verify a signature.
A sender uses the recipient's public key and an appropriate RSA encryption scheme to protect data.
The recipient uses the corresponding private key to recover the protected information.
RSA begins with two prime numbers. These numbers are multiplied together to create a larger number called the modulus, represented by the letter N.
Multiplying two prime numbers is straightforward. However, determining the original prime factors from a sufficiently large product is computationally difficult using classical computers.
This mathematical relationship is central to RSA's security.
Real RSA uses extremely large prime numbers. These small values are shown only to explain the underlying mathematical concept.
The following example demonstrates the basic mathematical operations behind RSA. It uses small numbers so the calculations are easier to follow.
P = 7 and Q = 11
N = 7 × 11 = 77
φ(N) = (7 − 1) × (11 − 1)
φ(N) = 6 × 10 = 60
E = 7
E must be relatively prime to 60.
D = 43
(7 × 43) mod 60 = 1
RSA can support two different security functions. Although both use public and private keys, they solve different problems.
Encryption protects confidentiality. A sender uses the recipient's public key, and the recipient uses the corresponding private key to decrypt the data.
Digital signatures help verify who signed information and whether it has been altered. The signer uses a private key, and others use the matching public key to verify the signature.
Modern RSA implementations use carefully designed cryptographic standards rather than the simplified mathematical formulas shown in educational examples.
A standardized padding scheme used with RSA encryption to provide stronger protection than raw textbook RSA.
A standardized signature scheme used to create and verify RSA digital signatures.
RSA private keys must be carefully generated, stored, protected, and replaced when necessary.
RSA security depends on appropriate key sizes, secure implementation, cryptographic padding, and proper private-key protection. RSA is not a substitute for a complete security strategy.