# RSA Algorithm: Encryption & Example

Instructor: David Gloag
With the ever increasing instances of Internet-based commerce, it makes sense that protecting those transactions will become more and more important. In this lesson, we'll take a look at a commonly used algorithm, RSA, how it works, and where it is used.

## Protecting Life on the Internet

In North America, there are many of us that spend time on the Internet. We send email to one another, we interact on social media websites, and we purchase things that have value or meaning to us. In fact, it's part of our social fabric. But with the pervasiveness of the Internet, have you ever wondered why someone hasn't tried to take advantage of the situation? You know, people with malicious intent who would steal your money, or sell your account information? In fact, someone likely has. You haven't heard about it though because there is protection in place, protection that keeps your information safe. Part of that protection is composed of encryption, and one specific type is RSA.

## What is Encryption?

Encryption is the process of taking information in one form (usually human-readable), and converting it to another form (not usually human-readable). It is mathematically based and makes use of an external piece of information, known as a key, to perform this conversion. There are several different types of encryption, and they are used for various things. Common examples include protecting the password on your cell phone, securing personal information stored on social media websites like LinkedIn, and hiding the login credentials used for web access to your bank account. Whatever the use, encryption is quietly doing its work, behind the scenes.

## What is the RSA Algorithm?

RSA, named after the researchers who initially proposed it (Rivest, Shamir, and Adleman) is a type of public key encryption. Public key encryption is a form of encryption that uses two keys: a public key, which everyone knows, and a private key, which only you know. To encrypt, the public key is applied to the target information, using a predefined operation (several times), to produce a pseudo-random number. To decrypt, the private key is applied to the pseudo-random number, using a different predefined operation (several times), to get the target information back. The algorithm relies on the fact that encryption is easy and decryption is hard, making decryption impractical without the key. It was the first system to allow secure information transfer, without a shared key.

## How Does It Work?

Let's take a look at an example. The RSA algorithm starts out by selecting two prime numbers. Normally, these would be very large, but for the sake of simplicity, let's say they are 13 and 7. Multiplying them together, we get 91. This becomes our maximum, and roll-over point. It also typically represents a value that is as big as the computer can handle. Next, we select the public key. Let's say it is 5. Using the fact that 13 and 7 are factors of 91, and the Extended Euclidean Algorithm, you can determine the private key to be 29. The Extended Euclidean Algorithm allows you to calculate, in an iterative fashion, the greatest common divisor and various coefficients.

To unlock this lesson you must be a Study.com Member.

### Register for a free trial

Are you a student or a teacher?

#### See for yourself why 30 million people use Study.com

##### Become a Study.com member and start learning now.
Back
What teachers are saying about Study.com

### Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.