SlideShare a Scribd company logo
1 of 2
Download to read offline
7 RSA Cryptosystem                                                                   ax    0   1    2    3      4   5   6
                                                                                      0    0   0    0    0      0   0   0
                                                                                      1    1   1    1    1      1   1   1
Addition and multiplication modulo n do not offer the
                                                                                      2    1   2    4    1      2   4   1
computational difficulties needed to build a viable cryp-
                                                                                      3    1   3    2    6      4   5   1
tographic system. We will see that exponentiation modulo                              4    1   4    2    1      4   2   1
n does.
                                                                                      5    1   5    4    6      2   3   1
                                                                                      6    1   6    1    6      1   6   1
Operations as functions. Recall that +n and ·n each                     Table 5: Exponentiation modulo n = 7. We write x from left to
read two integers and return a third integer. If we fix one of           right and a from top to bottom.
the two input integers, we get two functions. Specifically,
fixing a ∈ Zn , we have functions Aa : Zn → Zn and
Ma : Zn → Zn defined by                                                  P ROOF. Since p is prime, multiplication with a gives an
                                                                        injective function for every non-zero a ∈ Zp . In other
                    Aa (x)    = x +n a;                                 words, multiplying with a permutes the non-zero integers
                   Ma (x)     = x ·n a;                                 in Zp . Hence,

see Table 4. Clearly, Aa is injective for every choice of                   X    = 1 ·p 2 ·p . . . ·p (p − 1)
                                                                                 = (1 ·p a) ·p (2 ·p a) ·p . . . ·p ((p − 1) ·p a)
                x        0   1       2   3   4   5
                                                                                 = X ·p (ap−1 mod p).
              A2 (x)     2   3       4   5   0   1
              M2 (x)     0   2       4   0   2   4                      Multiplying with the inverse of X gives ap−1 mod p = 1.
Table 4: The function A2 defined by adding 2 modulo n = 6
is injective. In contrast, the function M2 defined by multiplying
with 2 is not injective.
                                                                        Protocol. The RSA cryptosystem is based on the exis-
                                                                        tence of one-way functions f : Zn → Zn defined by the
n > 0 and a ∈ Zn . On the other hand, Property II stated                following three properties:
in Section 5 implies that Ma is injective iff gcd(a, n) = 1.
In particular, Ma is injective for every non-zero a ∈ Zn if
                                                                          • f is easy to compute;
n is prime.
                                                                          • its inverse, f −1 : Zn → Zn , exists;
                                                                          • without extra information, f −1 is hard to compute.
Exponentiation. Yet another function we may consider
is taking a to the x-th power. Define Ea : Zn → Zn by
                                                                        The notions of ‘easy’ and ‘hard’ computation have to be
               Ea (x)            x
                         = a mod n                                      made precise, but this is beyond the scope of this course.
                                                                        Roughly, it means that given x, computing y = f (x) takes
                         = a ·n a ·n . . . ·n a,                        on the order of a few seconds while computing f −1 (y)
                                                                        takes on the order of years. RSA uses the following recipe
where we multiply x copies of a together. To get a feeling
                                                                        to construct one-way functions:
for this construction, Table 5 shows the seven functions of
the form Ea (x) = ax for n = 7. Clearly, E0 (x) = 0
                                                                         1. Choose large primes p and q, and let n = pq.
for every x. In contrast, we have Ea (x) = 0 mod n for
all a = 0 mod n because n = 7 is a prime. Note also                      2. Choose e = 1 relative prime to (p − 1)(q − 1) and let
that for some values of a, the restriction of Ea to the non-                d be its multiplicative inverse modulo (p − 1)(q − 1).
zero integers is injective and for others it is not. Perhaps             3. The one-way function is defined by f (x) = xe mod
surprisingly, the last column of Table 5 is 1 for almost all                n and its inverse is defined by g(y) = y d mod n.
values of a.
                                                                        According to the RSA protocol, Bob publishes e and n and
  F ERMAT ’ S L ITTLE T HEOREM. Let p be prime. Then                    keeps d private. Finally, Alice and Bob use the following
ap−1 mod p = 1 for every non-zero a ∈ Zp .                              two steps to exchange a secret message, x ∈ Zn :




                                                                   21
4. Alice computes y = f (x) and publishes y.                       Summary. We talked about exponentiation modulo n
                                                                    and proved Fermat’s Little Theorem. We then described
 5. Bob reads y and computes z = g(y).
                                                                    how RSA uses exponentiation to construct one-way func-
                                                                    tions, and we proved it correct. A proof that RSA is secure
To show that RSA is secure, we would need to prove                  would be nice but is beyond what is currently known. Be-
that without knowing p, q, d, it is hard to compute g. We           sides, it might not be secure.
leave this to future generations of computer scientists. In-
deed, nobody today can prove that computing p and q from
n = pq is hard, but then nobody knows how to factor large
integers efficiently either.


Correctness. To show that RSA works, we need to
prove that z = x. In other words, g(y) = f −1 (y) for every
y ∈ Zn . Recall that y is computed as f (x) = xe mod n.
We need y d mod n = x but we first prove a result that is
weaker.


 L EMMA. y d mod p = x mod p for every x ∈ Zn .

P ROOF. Since d is the multiplicative inverse of e modulo
(p − 1)(q − 1), we can write ed = (p − 1)(q − 1)k + 1.
Hence,

        y d mod p      = xed mod p
                       = xk(p−1)(q−1)+1 mod p.

Suppose first that xk(q−1) mod p = 0. Then Fermat’s Lit-
tle Theorem implies xk(p−1)(q−1) mod p = 1, which im-
plies y d mod p = x mod p, as claimed. Suppose second
that xk(q−1) mod p = 0. Since p is prime, every power
of a non-zero integer is non-zero. Hence, x mod p = 0.
But this implies y d mod p = 0 and thus y d mod p =
x mod p, as before.
  By symmetry, we also have y d mod q = x mod q.
Hence,

                (y d − x) mod p     = 0;
                   d
                (y − x) mod q       = 0.

By the Chinese Remainder Theorem, this system of two
linear equations has a unique solution in Zn , where n =
pq. Since y d − x = 0 is a solution, there can be no other.
Hence,

                (y d − x) mod n     = 0.

The left hand side can be written as ((y d mod n) −
x) mod n. This finally implies y d mod n = x, as desired.




                                                               22

More Related Content

What's hot

Complex form fourier series
Complex form fourier seriesComplex form fourier series
Complex form fourier seriesderry92
 
Research Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and ScienceResearch Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and Scienceresearchinventy
 
Difrentiation
DifrentiationDifrentiation
Difrentiationlecturer
 
Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)Matthew Leingang
 
The wild McKay correspondence
The wild McKay correspondenceThe wild McKay correspondence
The wild McKay correspondenceTakehiko Yasuda
 
The Magic of Auto Differentiation
The Magic of Auto DifferentiationThe Magic of Auto Differentiation
The Magic of Auto DifferentiationSanyam Kapoor
 
On non-negative unbiased estimators
On non-negative unbiased estimatorsOn non-negative unbiased estimators
On non-negative unbiased estimatorsPierre Jacob
 
Submodularity slides
Submodularity slidesSubmodularity slides
Submodularity slidesdragonthu
 
Inverse trigonometric functions xii[1]
Inverse trigonometric functions xii[1]Inverse trigonometric functions xii[1]
Inverse trigonometric functions xii[1]indu thakur
 
Regret Minimization in Multi-objective Submodular Function Maximization
Regret Minimization in Multi-objective Submodular Function MaximizationRegret Minimization in Multi-objective Submodular Function Maximization
Regret Minimization in Multi-objective Submodular Function MaximizationTasuku Soma
 
Exponential and logrithmic functions
Exponential and logrithmic functionsExponential and logrithmic functions
Exponential and logrithmic functionsMalikahmad105
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncrEdhole.com
 
preCalculus: Quiz11D Matrix Applications
preCalculus: Quiz11D Matrix ApplicationspreCalculus: Quiz11D Matrix Applications
preCalculus: Quiz11D Matrix ApplicationsA Jorge Garcia
 
Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!Ashutosh Tripathi
 
Lesson 1: Functions and their Representations
Lesson 1: Functions and their RepresentationsLesson 1: Functions and their Representations
Lesson 1: Functions and their RepresentationsMatthew Leingang
 

What's hot (18)

Complex form fourier series
Complex form fourier seriesComplex form fourier series
Complex form fourier series
 
Research Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and ScienceResearch Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and Science
 
Difrentiation
DifrentiationDifrentiation
Difrentiation
 
Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)Lesson 1: Functions and their representations (slides)
Lesson 1: Functions and their representations (slides)
 
My own exp nd radi
My own exp nd radiMy own exp nd radi
My own exp nd radi
 
The wild McKay correspondence
The wild McKay correspondenceThe wild McKay correspondence
The wild McKay correspondence
 
The Magic of Auto Differentiation
The Magic of Auto DifferentiationThe Magic of Auto Differentiation
The Magic of Auto Differentiation
 
On non-negative unbiased estimators
On non-negative unbiased estimatorsOn non-negative unbiased estimators
On non-negative unbiased estimators
 
Submodularity slides
Submodularity slidesSubmodularity slides
Submodularity slides
 
Inverse trigonometric functions xii[1]
Inverse trigonometric functions xii[1]Inverse trigonometric functions xii[1]
Inverse trigonometric functions xii[1]
 
Regret Minimization in Multi-objective Submodular Function Maximization
Regret Minimization in Multi-objective Submodular Function MaximizationRegret Minimization in Multi-objective Submodular Function Maximization
Regret Minimization in Multi-objective Submodular Function Maximization
 
Exponential and logrithmic functions
Exponential and logrithmic functionsExponential and logrithmic functions
Exponential and logrithmic functions
 
Mgm
MgmMgm
Mgm
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
preCalculus: Quiz11D Matrix Applications
preCalculus: Quiz11D Matrix ApplicationspreCalculus: Quiz11D Matrix Applications
preCalculus: Quiz11D Matrix Applications
 
Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!Primes: a quick tour to spplications and challenges!
Primes: a quick tour to spplications and challenges!
 
Lesson 1: Functions and their Representations
Lesson 1: Functions and their RepresentationsLesson 1: Functions and their Representations
Lesson 1: Functions and their Representations
 
Chapter 5 (maths 3)
Chapter 5 (maths 3)Chapter 5 (maths 3)
Chapter 5 (maths 3)
 

Similar to RSA Cryptosystem

EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMankita pandey
 
UMAP - Mathematics and implementational details
UMAP - Mathematics and implementational detailsUMAP - Mathematics and implementational details
UMAP - Mathematics and implementational detailsUmberto Lupo
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via MeshingDon Sheehy
 
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...Avichai Cohen
 
Ian.petrow【transcendental number theory】.
Ian.petrow【transcendental number theory】.Ian.petrow【transcendental number theory】.
Ian.petrow【transcendental number theory】.Tong Leung
 
5.1 Defining and visualizing functions. A handout.
5.1 Defining and visualizing functions. A handout.5.1 Defining and visualizing functions. A handout.
5.1 Defining and visualizing functions. A handout.Jan Plaza
 
Practical computation of Hecke operators
Practical computation of Hecke operatorsPractical computation of Hecke operators
Practical computation of Hecke operatorsMathieu Dutour Sikiric
 
Algebraic techniques in combinatorics
Algebraic techniques in combinatoricsAlgebraic techniques in combinatorics
Algebraic techniques in combinatoricsVui Lên Bạn Nhé
 
Solving trignometric equations
Solving trignometric equationsSolving trignometric equations
Solving trignometric equationsTarun Gehlot
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved exMaths Tutoring
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingzukun
 
03 conditional random field
03 conditional random field03 conditional random field
03 conditional random fieldzukun
 
Varian, microeconomic analysis, solution book
Varian, microeconomic analysis, solution bookVarian, microeconomic analysis, solution book
Varian, microeconomic analysis, solution bookJosé Antonio PAYANO YALE
 

Similar to RSA Cryptosystem (20)

Number theory
Number theoryNumber theory
Number theory
 
LPS talk notes
LPS talk notesLPS talk notes
LPS talk notes
 
EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREM
 
UMAP - Mathematics and implementational details
UMAP - Mathematics and implementational detailsUMAP - Mathematics and implementational details
UMAP - Mathematics and implementational details
 
Topological Inference via Meshing
Topological Inference via MeshingTopological Inference via Meshing
Topological Inference via Meshing
 
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...
Amirim Project - Threshold Functions in Random Simplicial Complexes - Avichai...
 
Ian.petrow【transcendental number theory】.
Ian.petrow【transcendental number theory】.Ian.petrow【transcendental number theory】.
Ian.petrow【transcendental number theory】.
 
5.1 Defining and visualizing functions. A handout.
5.1 Defining and visualizing functions. A handout.5.1 Defining and visualizing functions. A handout.
5.1 Defining and visualizing functions. A handout.
 
Complex Eigenvalues
Complex EigenvaluesComplex Eigenvalues
Complex Eigenvalues
 
Practical computation of Hecke operators
Practical computation of Hecke operatorsPractical computation of Hecke operators
Practical computation of Hecke operators
 
Lecture 9 f17
Lecture 9 f17Lecture 9 f17
Lecture 9 f17
 
Algebraic techniques in combinatorics
Algebraic techniques in combinatoricsAlgebraic techniques in combinatorics
Algebraic techniques in combinatorics
 
Solving trignometric equations
Solving trignometric equationsSolving trignometric equations
Solving trignometric equations
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programming
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
Raices primitivas
Raices primitivasRaices primitivas
Raices primitivas
 
Functions (Theory)
Functions (Theory)Functions (Theory)
Functions (Theory)
 
03 conditional random field
03 conditional random field03 conditional random field
03 conditional random field
 
Varian, microeconomic analysis, solution book
Varian, microeconomic analysis, solution bookVarian, microeconomic analysis, solution book
Varian, microeconomic analysis, solution book
 

More from Aniruddh Tyagi

More from Aniruddh Tyagi (20)

security vulnerabilities of dvb chipsets
security vulnerabilities of dvb chipsetssecurity vulnerabilities of dvb chipsets
security vulnerabilities of dvb chipsets
 
whitepaper_mpeg-if_understanding_mpeg4
whitepaper_mpeg-if_understanding_mpeg4whitepaper_mpeg-if_understanding_mpeg4
whitepaper_mpeg-if_understanding_mpeg4
 
BUC BLOCK UP CONVERTER
BUC BLOCK UP CONVERTERBUC BLOCK UP CONVERTER
BUC BLOCK UP CONVERTER
 
digital_set_top_box2
digital_set_top_box2digital_set_top_box2
digital_set_top_box2
 
Discrete cosine transform
Discrete cosine transformDiscrete cosine transform
Discrete cosine transform
 
DCT
DCTDCT
DCT
 
EBU_DVB_S2 READY TO LIFT OFF
EBU_DVB_S2 READY TO LIFT OFFEBU_DVB_S2 READY TO LIFT OFF
EBU_DVB_S2 READY TO LIFT OFF
 
ADVANCED DVB-C,DVB-S STB DEMOD
ADVANCED DVB-C,DVB-S STB DEMODADVANCED DVB-C,DVB-S STB DEMOD
ADVANCED DVB-C,DVB-S STB DEMOD
 
DVB_Arch
DVB_ArchDVB_Arch
DVB_Arch
 
haffman coding DCT transform
haffman coding DCT transformhaffman coding DCT transform
haffman coding DCT transform
 
tyagi 's doc
tyagi 's doctyagi 's doc
tyagi 's doc
 
quantization_PCM
quantization_PCMquantization_PCM
quantization_PCM
 
ECMG & EMMG protocol
ECMG & EMMG protocolECMG & EMMG protocol
ECMG & EMMG protocol
 
7015567A
7015567A7015567A
7015567A
 
Basic of BISS
Basic of BISSBasic of BISS
Basic of BISS
 
euler theorm
euler theormeuler theorm
euler theorm
 
fundamentals_satellite_communication_part_1
fundamentals_satellite_communication_part_1fundamentals_satellite_communication_part_1
fundamentals_satellite_communication_part_1
 
quantization
quantizationquantization
quantization
 
art_sklar7_reed-solomon
art_sklar7_reed-solomonart_sklar7_reed-solomon
art_sklar7_reed-solomon
 
DVBSimulcrypt2
DVBSimulcrypt2DVBSimulcrypt2
DVBSimulcrypt2
 

RSA Cryptosystem

  • 1. 7 RSA Cryptosystem ax 0 1 2 3 4 5 6 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Addition and multiplication modulo n do not offer the 2 1 2 4 1 2 4 1 computational difficulties needed to build a viable cryp- 3 1 3 2 6 4 5 1 tographic system. We will see that exponentiation modulo 4 1 4 2 1 4 2 1 n does. 5 1 5 4 6 2 3 1 6 1 6 1 6 1 6 1 Operations as functions. Recall that +n and ·n each Table 5: Exponentiation modulo n = 7. We write x from left to read two integers and return a third integer. If we fix one of right and a from top to bottom. the two input integers, we get two functions. Specifically, fixing a ∈ Zn , we have functions Aa : Zn → Zn and Ma : Zn → Zn defined by P ROOF. Since p is prime, multiplication with a gives an injective function for every non-zero a ∈ Zp . In other Aa (x) = x +n a; words, multiplying with a permutes the non-zero integers Ma (x) = x ·n a; in Zp . Hence, see Table 4. Clearly, Aa is injective for every choice of X = 1 ·p 2 ·p . . . ·p (p − 1) = (1 ·p a) ·p (2 ·p a) ·p . . . ·p ((p − 1) ·p a) x 0 1 2 3 4 5 = X ·p (ap−1 mod p). A2 (x) 2 3 4 5 0 1 M2 (x) 0 2 4 0 2 4 Multiplying with the inverse of X gives ap−1 mod p = 1. Table 4: The function A2 defined by adding 2 modulo n = 6 is injective. In contrast, the function M2 defined by multiplying with 2 is not injective. Protocol. The RSA cryptosystem is based on the exis- tence of one-way functions f : Zn → Zn defined by the n > 0 and a ∈ Zn . On the other hand, Property II stated following three properties: in Section 5 implies that Ma is injective iff gcd(a, n) = 1. In particular, Ma is injective for every non-zero a ∈ Zn if • f is easy to compute; n is prime. • its inverse, f −1 : Zn → Zn , exists; • without extra information, f −1 is hard to compute. Exponentiation. Yet another function we may consider is taking a to the x-th power. Define Ea : Zn → Zn by The notions of ‘easy’ and ‘hard’ computation have to be Ea (x) x = a mod n made precise, but this is beyond the scope of this course. Roughly, it means that given x, computing y = f (x) takes = a ·n a ·n . . . ·n a, on the order of a few seconds while computing f −1 (y) takes on the order of years. RSA uses the following recipe where we multiply x copies of a together. To get a feeling to construct one-way functions: for this construction, Table 5 shows the seven functions of the form Ea (x) = ax for n = 7. Clearly, E0 (x) = 0 1. Choose large primes p and q, and let n = pq. for every x. In contrast, we have Ea (x) = 0 mod n for all a = 0 mod n because n = 7 is a prime. Note also 2. Choose e = 1 relative prime to (p − 1)(q − 1) and let that for some values of a, the restriction of Ea to the non- d be its multiplicative inverse modulo (p − 1)(q − 1). zero integers is injective and for others it is not. Perhaps 3. The one-way function is defined by f (x) = xe mod surprisingly, the last column of Table 5 is 1 for almost all n and its inverse is defined by g(y) = y d mod n. values of a. According to the RSA protocol, Bob publishes e and n and F ERMAT ’ S L ITTLE T HEOREM. Let p be prime. Then keeps d private. Finally, Alice and Bob use the following ap−1 mod p = 1 for every non-zero a ∈ Zp . two steps to exchange a secret message, x ∈ Zn : 21
  • 2. 4. Alice computes y = f (x) and publishes y. Summary. We talked about exponentiation modulo n and proved Fermat’s Little Theorem. We then described 5. Bob reads y and computes z = g(y). how RSA uses exponentiation to construct one-way func- tions, and we proved it correct. A proof that RSA is secure To show that RSA is secure, we would need to prove would be nice but is beyond what is currently known. Be- that without knowing p, q, d, it is hard to compute g. We sides, it might not be secure. leave this to future generations of computer scientists. In- deed, nobody today can prove that computing p and q from n = pq is hard, but then nobody knows how to factor large integers efficiently either. Correctness. To show that RSA works, we need to prove that z = x. In other words, g(y) = f −1 (y) for every y ∈ Zn . Recall that y is computed as f (x) = xe mod n. We need y d mod n = x but we first prove a result that is weaker. L EMMA. y d mod p = x mod p for every x ∈ Zn . P ROOF. Since d is the multiplicative inverse of e modulo (p − 1)(q − 1), we can write ed = (p − 1)(q − 1)k + 1. Hence, y d mod p = xed mod p = xk(p−1)(q−1)+1 mod p. Suppose first that xk(q−1) mod p = 0. Then Fermat’s Lit- tle Theorem implies xk(p−1)(q−1) mod p = 1, which im- plies y d mod p = x mod p, as claimed. Suppose second that xk(q−1) mod p = 0. Since p is prime, every power of a non-zero integer is non-zero. Hence, x mod p = 0. But this implies y d mod p = 0 and thus y d mod p = x mod p, as before. By symmetry, we also have y d mod q = x mod q. Hence, (y d − x) mod p = 0; d (y − x) mod q = 0. By the Chinese Remainder Theorem, this system of two linear equations has a unique solution in Zn , where n = pq. Since y d − x = 0 is a solution, there can be no other. Hence, (y d − x) mod n = 0. The left hand side can be written as ((y d mod n) − x) mod n. This finally implies y d mod n = x, as desired. 22