RSA (Rivest–Shamir–Adleman) is a
public-key cryptosystem that is widely used for secure data transmission. It is also one of the oldest. The
acronym
An acronym is a word or name formed from the initial components of a longer name or phrase. Acronyms are usually formed from the initial letters of words, as in '' NATO'' (''North Atlantic Treaty Organization''), but sometimes use syllables, a ...
"RSA" comes from the surnames of
Ron Rivest
Ronald Linn Rivest (; born May 6, 1947) is a cryptographer and an Institute Professor at MIT. He is a member of MIT's Department of Electrical Engineering and Computer Science (EECS) and a member of MIT's Computer Science and Artificial Int ...
,
Adi Shamir
Adi Shamir ( he, עדי שמיר; born July 6, 1952) is an Israeli cryptographer. He is a co-inventor of the Rivest–Shamir–Adleman (RSA) algorithm (along with Ron Rivest and Len Adleman), a co-inventor of the Feige–Fiat–Shamir identifica ...
and
Leonard Adleman
Leonard Adleman (born December 31, 1945) is an American computer scientist. He is one of the creators of the RSA encryption algorithm, for which he received the 2002 Turing Award, often called the Nobel prize of Computer science. He is also know ...
, who publicly described the algorithm in 1977. An equivalent system was developed secretly in 1973 at
Government Communications Headquarters
Government Communications Headquarters, commonly known as GCHQ, is an intelligence and security organisation responsible for providing signals intelligence (SIGINT) and information assurance (IA) to the government and armed forces of the ...
(GCHQ) (the British
signals intelligence
Signals intelligence (SIGINT) is intelligence-gathering by interception of '' signals'', whether communications between people (communications intelligence—abbreviated to COMINT) or from electronic signals not directly used in communication ...
agency) by the English mathematician
Clifford Cocks
Clifford Christopher Cocks (born 28 December 1950) is a British mathematician and cryptographer.
In 1973, while working at the United Kingdom Government Communications Headquarters (GCHQ), he invented a public-key cryptography algorithm equiv ...
. That system was
declassified
Declassification is the process of ceasing a protective Classified information, classification, often under the principle of freedom of information. Procedures for declassification vary by country. Papers may be withheld without being classif ...
in 1997.
In a public-key
cryptosystem
In cryptography, a cryptosystem is a suite of cryptographic algorithms needed to implement a particular security service, such as confidentiality (encryption).
Typically, a cryptosystem consists of three algorithms: one for key generation, one f ...
, the
encryption key
A key in cryptography is a piece of information, usually a string of numbers or letters that are stored in a file, which, when processed through a cryptographic algorithm, can encode or decode cryptographic data. Based on the used method, the key ...
is public and distinct from the
decryption key
In cryptography, encryption is the process of Code, encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can ...
, which is kept secret (private).
An RSA user creates and publishes a public key based on two large
prime number
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only way ...
s, along with an auxiliary value. The prime numbers are kept secret. Messages can be encrypted by anyone, via the public key, but can only be decoded by someone who knows the prime numbers.
The security of RSA relies on the practical difficulty of
factoring the product of two large
prime number
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only way ...
s, the "
factoring problem". Breaking RSA encryption is known as the
RSA problem. Whether it is as difficult as the factoring problem is an open question. There are no published methods to defeat the system if a large enough key is used.
RSA is a relatively slow algorithm. Because of this, it is not commonly used to directly encrypt user data. More often, RSA is used to transmit shared keys for
symmetric-key cryptography, which are then used for bulk encryption–decryption.
History

The idea of an asymmetric public-private key cryptosystem is attributed to
Whitfield Diffie and
Martin Hellman
Martin Edward Hellman (born October 2, 1945) is an American cryptologist and mathematician, best known for his involvement with public key cryptography in cooperation with Whitfield Diffie and Ralph Merkle. Hellman is a longtime contributor to ...
, who published this concept in 1976. They also introduced digital signatures and attempted to apply number theory. Their formulation used a shared-secret-key created from exponentiation of some number, modulo a prime number. However, they left open the problem of realizing a one-way function, possibly because the difficulty of factoring was not well-studied at the time.
Ron Rivest
Ronald Linn Rivest (; born May 6, 1947) is a cryptographer and an Institute Professor at MIT. He is a member of MIT's Department of Electrical Engineering and Computer Science (EECS) and a member of MIT's Computer Science and Artificial Int ...
,
Adi Shamir
Adi Shamir ( he, עדי שמיר; born July 6, 1952) is an Israeli cryptographer. He is a co-inventor of the Rivest–Shamir–Adleman (RSA) algorithm (along with Ron Rivest and Len Adleman), a co-inventor of the Feige–Fiat–Shamir identifica ...
, and
Leonard Adleman
Leonard Adleman (born December 31, 1945) is an American computer scientist. He is one of the creators of the RSA encryption algorithm, for which he received the 2002 Turing Award, often called the Nobel prize of Computer science. He is also know ...
at the
Massachusetts Institute of Technology
The Massachusetts Institute of Technology (MIT) is a Private university, private Land-grant university, land-grant research university in Cambridge, Massachusetts. Established in 1861, MIT has played a key role in the development of modern t ...
made several attempts over the course of a year to create a one-way function that was hard to invert. Rivest and Shamir, as computer scientists, proposed many potential functions, while Adleman, as a mathematician, was responsible for finding their weaknesses. They tried many approaches, including "
knapsack
A backpack—also called knapsack, schoolbag, rucksack, rucksac, pack, sackpack, booksack, bookbag or backsack—is, in its simplest frameless form, a fabric sack carried on one's back and secured with two straps that go over the shoulders ...
-based" and "permutation polynomials". For a time, they thought what they wanted to achieve was impossible due to contradictory requirements. In April 1977, they spent
Passover
Passover, also called Pesach (; ), is a major Jewish holiday that celebrates the Biblical story of the Israelites escape from slavery in Egypt, which occurs on the 15th day of the Hebrew month of Nisan, the first month of Aviv, or spring. ...
at the house of a student and drank a good deal of
Manischewitz wine before returning to their homes at around midnight. Rivest, unable to sleep, lay on the couch with a math textbook and started thinking about their one-way function. He spent the rest of the night formalizing his idea, and he had much of the paper ready by daybreak. The algorithm is now known as RSA the initials of their surnames in same order as their paper.
Clifford Cocks
Clifford Christopher Cocks (born 28 December 1950) is a British mathematician and cryptographer.
In 1973, while working at the United Kingdom Government Communications Headquarters (GCHQ), he invented a public-key cryptography algorithm equiv ...
, an English
mathematician
A mathematician is someone who uses an extensive knowledge of mathematics in their work, typically to solve mathematical problems.
Mathematicians are concerned with numbers, data, quantity, mathematical structure, structure, space, Mathematica ...
working for the
British intelligence agency
Government Communications Headquarters
Government Communications Headquarters, commonly known as GCHQ, is an intelligence and security organisation responsible for providing signals intelligence (SIGINT) and information assurance (IA) to the government and armed forces of the ...
(GCHQ), described an equivalent system in an internal document in 1973. However, given the relatively expensive computers needed to implement it at the time, it was considered to be mostly a curiosity and, as far as is publicly known, was never deployed. His discovery, however, was not revealed until 1997 due to its top-secret classification.
Kid-RSA (KRSA) is a simplified, insecure public-key cipher published in 1997, designed for educational purposes. Some people feel that learning Kid-RSA gives insight into RSA and other public-key ciphers, analogous to
simplified DES.
Patent
A
patent
A patent is a type of intellectual property that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of time in exchange for publishing an sufficiency of disclosure, enabling disclo ...
describing the RSA algorithm was granted to
MIT
The Massachusetts Institute of Technology (MIT) is a private land-grant research university in Cambridge, Massachusetts. Established in 1861, MIT has played a key role in the development of modern technology and science, and is one of the ...
on 20 September 1983: "Cryptographic communications system and method". From
DWPI's abstract of the patent:
A detailed description of the algorithm was published in August 1977, in
Scientific American
''Scientific American'', informally abbreviated ''SciAm'' or sometimes ''SA'', is an American popular science magazine. Many famous scientists, including Albert Einstein and Nikola Tesla, have contributed articles to it. In print since 1845, it i ...
's
Mathematical Games
A mathematical game is a game whose rules, strategies, and outcomes are defined by clear mathematical parameters. Often, such games have simple rules and match procedures, such as Tic-tac-toe and Dots and Boxes. Generally, mathematical games ne ...
column.
This preceded the patent's filing date of December 1977. Consequently, the patent had no legal standing outside the
United States
The United States of America (U.S.A. or USA), commonly known as the United States (U.S. or US) or America, is a country primarily located in North America. It consists of 50 U.S. state, states, a Washington, D.C., federal district, five ma ...
. Had Cocks's work been publicly known, a patent in the United States would not have been legal either.
When the patent was issued,
terms of patent were 17 years. The patent was about to expire on 21 September 2000, but
RSA Security
RSA Security LLC, formerly RSA Security, Inc. and doing business as RSA, is an American computer security, computer and network security company with a focus on encryption and encryption standards. RSA was named after the initials of its co-fo ...
released the algorithm to the public domain on 6 September 2000.
Operation
The RSA algorithm involves four steps:
key generation, key distribution, encryption, and decryption.
A basic principle behind RSA is the observation that it is practical to find three very large positive integers , , and , such that with
modular exponentiation for all integers (with ):
and that knowing and , or even , it can be extremely difficult to find . The
triple bar
The triple bar, or tribar ≡, is a symbol with multiple, context-dependent meanings. It has the appearance of an equals sign sign with a third line. The triple bar character in Unicode is code point .. The closely related code point ...
(≡) here denotes
modular congruence (which is to say that when you divide by and by , they both have the same remainder).
In addition, for some operations it is convenient that the order of the two exponentiations can be changed and that this relation also implies
RSA involves a ''public key'' and a ''
private key
Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
''. The public key can be known by everyone and is used for encrypting messages. The intention is