Need help understanding the RSA Encryption Algorithm? The two videos below give one of the best explanations on Youtube.

As a note, you should familiarize yourself with the modulus operation before learning the RSA encryption algorithm.

## Introduction to RSA Encryption

Suppose that Alice would like to send an encrypted message to Bob, she would need to use the public keys provided publicly by Bob to transform her plaintext to an integer that is in the domain `Z`

_{N} and is not a multiple of `p and q`

.

Converting a message to an integer is a requirement of the RSA Encryption Algorithm. That means that the message “Transfer complete” would first need to be converted into a numerical representation of the message. Look into number representation on Google for more details on how to convert messages to binary, decimal, or a different format.

### RSA Encryption Terminology

are random integers chosen by Bob*P and Q*are denoted as*Public keys*`N`

and`e`

is denoted as*Private Key*`d`

is the unencrypted message*Plaintext*is the encrypted message*Ciphertext*

Before Alice can send an encrypted message to BOB, she must encrypt the ** plaintext** message using the public keys (

`N and e`

) made publicly by Bob.
The encryption function for RSA is: *ciphertext*`= m`

^{e} mod N

When Bob receives the encrypted message, he uses his private key (`d`

) to decrypt the ciphertext using the following decryption formula.

The decryption function for RSA is:*plaintext*`= m`

^{d} mod N

### How to compute the public keys N and e

Bob computes **N** using `N = p * q`

He then determines **e** by finding a number such that `gcd(e, ϕ) = 1`

where `φ = (p−1)(q−1)`

### How to calculate the private key

The private key (`d`

) must satisfy the following equation: `d⋅e mod φ = 1`

where `φ = (p−1)(q−1)`

The following videos will walk you through calculating `N, e, and d`

and run through a couple of examples on using The RSA Encryption Algorithm.

## The RSA Encryption Algorithm

(Part 1 Video)

https://www.youtube.com/watch?v=4zahvcJ9glg