0% found this document useful (0 votes)
19 views3 pages

IS364 L02 Unit3a

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

IS364 L02 Unit3a

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

5/8/2019 IS 364: L/Unit 3: The RSA Algorithm

IS 364: IT Security
Home / My courses / IS 364 / 30 April - 6 May / L/Unit 3: The RSA Algorithm

L/Unit 3: The RSA Algorithm

The RSA Algorithm


The RSA algorithm is a cryptosystem that is based on an underlying hard problem. This algorithm
was introduced in 1978 by Rivest, Shamir, and Adelman. As with other algorithms, RSA has been
the subject of extensive cryptanalysis. There being no serious flaws found to date does not a
guarantee its security but suggests a high degree of confidence in its use. The Rivest-Shamir-
Adleman (RSA) scheme has reigned supreme as the most widely accepted and implemented
general-purpose approach to public-key encryption..

In this lecture, the RSA algorithm is presented in two parts. Firstly, an outline of the RSA is
presented to give you an idea of how it works relative to the other algorithms studied. Then, delve
more deeply into a detailed analysis of the steps involved.

1. Introduction to the RSA Algorithm


The RSA encryption algorithm incorporates results from number theory, combined with the difficulty
of determining the prime factors of a target. The RSA algorithm also operates with arithmetic mod n.
It is a block cipher in which the plaintext and ciphertext are integers between 0 and n-1 for some n. A
typical size for n is 1024 bits, or 309 decimal digits. That is, n is less than 21024.

Two keys, d and e, are used for decryption and encryption. They are actually interchangeable. The
plaintext block M is encrypted as Me mod n. Because the exponentiation is performed mod n,
factoring Pe to uncover the encrypted plaintext is difficult. However, the decrypting key d is carefully
chosen so that (Me)d mod n = P. Thus, the legitimate receiver who knows d simply computes (Me)d
mod n = M and recovers M without having to factor Me.

The encryption algorithm is based on the underlying problem of factoring large numbers. The
factorization problem is not known; the fastest known algorithm is exponential in time.

Description of the RSA Algorithm Principle and Function


The RSA scheme makes use of an expression with exponentials. Plaintext is encrypted in blocks,
with each block having a binary value less than some number n. That is, the block size must be less
than or equal to log2(n); in practice, the block size is i bits, where 2i < n 2i+1. Encryption and
decryption are of the following form, for some plaintext block M and ciphertext block C:

C = Me mod n

https://lms.udsm.ac.tz/mod/page/view.php?id=5416&forceview=1 1/3
5/8/2019 IS 364: L/Unit 3: The RSA Algorithm

P = Cd mod n = (Me)d mod n = Med mod n

Both sender and receiver must know the value of n. The sender knows the value of e, and only the
receiver knows the value of d. Thus, this is a public-key encryption algorithm with a public key of PU
= {e, n} and a private key of PU = {d, n}. For this algorithm to be satisfactory for public-key
encryption, the following requirements must be met:

1. It is possible to find values of e, d, n such that Med mod n = M for all M < n.

2. It is relatively easy to calculate mod Me mod n and Cd for all values of M < n.

3. It is infeasible to determine d given e and n.

For now, we focus on the first requirement and consider the other questions later. We need to find a
relationship of the form

Med mod n = M

The above relationship holds if e and d are multiplicative inverses modulo f(n), where f(n) is the
Euler totient function.

That is, e and d are multiplicative inverses mod f(n). Note that, according to the rules of modular
arithmetic, this is true only if d (and therefore e) is relatively prime to f(n). Equivalently, gcd(f(n),d) =
1. The RSA scheme with its ingredients can be stated as follows:

p,q, two prime numbers (private, chosen)

n = pq (public, calculated)

e, with gcd(f(n),e) = 1;1 < e < f(n)(public, chosen)

d e1(mod f(n)) (private, calculated)

The private key consists of {d, n} and the public key consists of {e, n}. Suppose that user A has
published its public key and that user B wishes to send the message M to A. Then B calculates C =
Me mod n and transmits C. On receipt of this ciphertext, user A decrypts by calculating M = Cd mod
n.

Figure 1summary of the RSA algorithm.

Demonstration of the RSA function using numerical examples

Example:

1. Select two prime numbers, p = 17 and q = 11.

2. Calculate n = pq = 17 x 11 = 187.

3. Calculate f(n) = (p 1)(q 1) = 16 x 10 = 160.

4. Select e such that e is relatively prime to f(n) = 160 and less than f(n) we choose e = 7.

5. Determine d such that de1 (mod 160) and d < 160. The correct value is d = 23, because 23 x 7 =
161 = 10 x 160 + 1; d can be calculated using the extended Euclid's algorithm.

https://lms.udsm.ac.tz/mod/page/view.php?id=5416&forceview=1 2/3
5/8/2019 IS 364: L/Unit 3: The RSA Algorithm

Reading: RSA Algorithm strength and weakness

References

1. Stallings, William - Cryptography And Network Security 4Th Ed - Prentice Hall - (2005)

2. Security in Computing, Fourth Edition By Charles P. Pfleeger. Pfleeger Consulting Group, Shari
Lawrence Pfleeger - RAND Corporation.

Last modified: Monday, 30 April 2018, 11:30 AM

◄ L/Unit 2: Public Key Cryptosystems


Jump to...

L/Unit 3: The RSA Algorithm Resource ►

You are logged in as Innocent Minja (Log out)


IS 364

Get the mobile app

https://lms.udsm.ac.tz/mod/page/view.php?id=5416&forceview=1 3/3

You might also like