SlideShare a Scribd company logo
Public key cryptography
R for Rivest, S for Shamir,
    and A for Adelman.
Generating the public keys
1. Pick two prime numbers p and q, eg 3 and
   11
2. Calculate their product n, n = 33
3. Calculate intermediate z (p-1)*(q-1), z = 20
4. Pick a prime k such that k is smaller than z
   and z is and not divisible by k, k = 7
5. The numbers n and k are the public key, in
   our case n=33, k=7
Generating the private key
• The private key j is given by the formula
  k * j = 1(mod z)
• In our example, k = 7, z = 20
  7 * j = 1(mod 20)
• Is satisfied by j = 3
• Our private key is 3
Encrypting and Decrypting
    • E is the encrypted value
    • P is the plaintext value
• Encrypting, say we send P = 14
  P ^ k = E(mod n)               14^7 = 105413504
                                 105413504 / 33 = 3194348.606
  14 ^ 7 = E(mod 33) = 20        3194348 * 33 = 105413484
                                 105413504 – 105413484 = 20


• E ^ j = P(mod n)               20^3 = 8000
                                 8000 / 33 = 242.42424242
• 20 ^ 3 = P(mod 33) = 14        242 * 33 = 7986
                                 8000 – 7986 = 14
Encrypting and Decrypting
    • E is the encrypted value
    • P is the plaintext value
• Encrypting, say we send P = 14
  P ^ k = E(mod n)               14^7 = 105413504
                                 105413504 / 33 = 3194348.606
  14 ^ 7 = E(mod 33) = 20        3194348 * 33 = 105413484
                                 105413504 – 105413484 = 20


• E ^ j = P(mod n)               20^3 = 8000
                                 8000 / 33 = 242.42424242
• 20 ^ 3 = P(mod 33) = 14        242 * 33 = 7986
                                 8000 – 7986 = 14

More Related Content

What's hot

Graficas de trigo
Graficas de trigoGraficas de trigo
Graficas de trigo
gemelo69
 
Querying solr
Querying solrQuerying solr
Querying solr
Samuel Solís Fuentes
 
Funciones1
Funciones1Funciones1
Funciones1
Ray Mera
 
Algebra i ccp quarter 1 benchmark review
Algebra i ccp quarter 1 benchmark reviewAlgebra i ccp quarter 1 benchmark review
Algebra i ccp quarter 1 benchmark review
ldaneau
 
Tarea de informatica
Tarea de informaticaTarea de informatica
Tarea de informatica
brylejo
 
Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)
Algebra / Mathematics
 
Math basic2
Math basic2Math basic2
Math basic2
ERUMSULAYMAN1
 
Maria
MariaMaria
Maria
candita
 
6TH-ADV-CH01-RATIONAL NUMBERS
6TH-ADV-CH01-RATIONAL NUMBERS6TH-ADV-CH01-RATIONAL NUMBERS
6TH-ADV-CH01-RATIONAL NUMBERS
Kumbarthi Hemachander
 
Assignment6
Assignment6Assignment6
Assignment6
Vinit Tiwari
 
Java Polymorphism
Java PolymorphismJava Polymorphism
Java Polymorphism
AathikaJava
 
A1 factoring gcm and grouping
A1   factoring gcm and groupingA1   factoring gcm and grouping
A1 factoring gcm and grouping
Nara Cocarelli
 
Module of integer exponents
Module of integer exponentsModule of integer exponents
Module of integer exponents
Nelson Benitez Talamor
 
Feb.27
Feb.27Feb.27
Feb.27
khyps13
 
Calculo 4,5
Calculo 4,5Calculo 4,5
Calculo 4,5
Niko Avila
 
Matlab file
Matlab file Matlab file
Matlab file
rampal singh
 
Metodologia de la programación - expresiones
Metodologia de la programación - expresionesMetodologia de la programación - expresiones
Metodologia de la programación - expresiones
Mar_Angeles
 
Factoring difference of squares
Factoring difference of squaresFactoring difference of squares
Factoring difference of squares
brittanyhurley1
 

What's hot (18)

Graficas de trigo
Graficas de trigoGraficas de trigo
Graficas de trigo
 
Querying solr
Querying solrQuerying solr
Querying solr
 
Funciones1
Funciones1Funciones1
Funciones1
 
Algebra i ccp quarter 1 benchmark review
Algebra i ccp quarter 1 benchmark reviewAlgebra i ccp quarter 1 benchmark review
Algebra i ccp quarter 1 benchmark review
 
Tarea de informatica
Tarea de informaticaTarea de informatica
Tarea de informatica
 
Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)
 
Math basic2
Math basic2Math basic2
Math basic2
 
Maria
MariaMaria
Maria
 
6TH-ADV-CH01-RATIONAL NUMBERS
6TH-ADV-CH01-RATIONAL NUMBERS6TH-ADV-CH01-RATIONAL NUMBERS
6TH-ADV-CH01-RATIONAL NUMBERS
 
Assignment6
Assignment6Assignment6
Assignment6
 
Java Polymorphism
Java PolymorphismJava Polymorphism
Java Polymorphism
 
A1 factoring gcm and grouping
A1   factoring gcm and groupingA1   factoring gcm and grouping
A1 factoring gcm and grouping
 
Module of integer exponents
Module of integer exponentsModule of integer exponents
Module of integer exponents
 
Feb.27
Feb.27Feb.27
Feb.27
 
Calculo 4,5
Calculo 4,5Calculo 4,5
Calculo 4,5
 
Matlab file
Matlab file Matlab file
Matlab file
 
Metodologia de la programación - expresiones
Metodologia de la programación - expresionesMetodologia de la programación - expresiones
Metodologia de la programación - expresiones
 
Factoring difference of squares
Factoring difference of squaresFactoring difference of squares
Factoring difference of squares
 

Viewers also liked

RSA
RSARSA
Rsa
RsaRsa
Cryptography
Cryptography Cryptography
Cryptography
pravin pandey
 
Rsa
RsaRsa
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
Arpana shree
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
Shashank Shetty
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
Indra97065
 

Viewers also liked (8)

RSA
RSARSA
RSA
 
Rsa
RsaRsa
Rsa
 
Cryptography
Cryptography Cryptography
Cryptography
 
Rsa
RsaRsa
Rsa
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 

Similar to Rsa encryption

Question 6
Question 6 Question 6
Question 6
M.T.H Group
 
LaplaceTransformIIT.pdf
LaplaceTransformIIT.pdfLaplaceTransformIIT.pdf
LaplaceTransformIIT.pdf
jenniecortesmomongan
 
Muchtadi
MuchtadiMuchtadi
OpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングOpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシング
Toshihiro Kamishima
 
5indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp025indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp02
Sofia Mahmood
 
Taller de Mecanica Calsica
Taller de Mecanica CalsicaTaller de Mecanica Calsica
Taller de Mecanica Calsica
Pedro Martin Ibarbo Perlaza
 
Goldberg-Coxeter construction for 3- or 4-valent plane maps
Goldberg-Coxeter construction for 3- or 4-valent plane mapsGoldberg-Coxeter construction for 3- or 4-valent plane maps
Goldberg-Coxeter construction for 3- or 4-valent plane maps
Mathieu Dutour Sikiric
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedah
Ruzita Kamil
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedah
umaralfaruqi
 
2. Definite Int. Theory Module-5.pdf
2. Definite Int. Theory Module-5.pdf2. Definite Int. Theory Module-5.pdf
2. Definite Int. Theory Module-5.pdf
RajuSingh806014
 
Integral
IntegralIntegral
Integral
Johan Sampoerno
 
workbook_full_solutions_2.pdf
workbook_full_solutions_2.pdfworkbook_full_solutions_2.pdf
workbook_full_solutions_2.pdf
ZiaSethi1
 
01. Differentiation-Theory & solved example Module-3.pdf
01. Differentiation-Theory & solved example Module-3.pdf01. Differentiation-Theory & solved example Module-3.pdf
01. Differentiation-Theory & solved example Module-3.pdf
RajuSingh806014
 

Similar to Rsa encryption (13)

Question 6
Question 6 Question 6
Question 6
 
LaplaceTransformIIT.pdf
LaplaceTransformIIT.pdfLaplaceTransformIIT.pdf
LaplaceTransformIIT.pdf
 
Muchtadi
MuchtadiMuchtadi
Muchtadi
 
OpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングOpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシング
 
5indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp025indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp02
 
Taller de Mecanica Calsica
Taller de Mecanica CalsicaTaller de Mecanica Calsica
Taller de Mecanica Calsica
 
Goldberg-Coxeter construction for 3- or 4-valent plane maps
Goldberg-Coxeter construction for 3- or 4-valent plane mapsGoldberg-Coxeter construction for 3- or 4-valent plane maps
Goldberg-Coxeter construction for 3- or 4-valent plane maps
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedah
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedah
 
2. Definite Int. Theory Module-5.pdf
2. Definite Int. Theory Module-5.pdf2. Definite Int. Theory Module-5.pdf
2. Definite Int. Theory Module-5.pdf
 
Integral
IntegralIntegral
Integral
 
workbook_full_solutions_2.pdf
workbook_full_solutions_2.pdfworkbook_full_solutions_2.pdf
workbook_full_solutions_2.pdf
 
01. Differentiation-Theory & solved example Module-3.pdf
01. Differentiation-Theory & solved example Module-3.pdf01. Differentiation-Theory & solved example Module-3.pdf
01. Differentiation-Theory & solved example Module-3.pdf
 

More from grahamwell

Pseudocode
PseudocodePseudocode
Pseudocode
grahamwell
 
Excel =if function
Excel =if functionExcel =if function
Excel =if function
grahamwell
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average
grahamwell
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
grahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
grahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
grahamwell
 
The software story
The software storyThe software story
The software story
grahamwell
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
grahamwell
 
Database field types
Database field typesDatabase field types
Database field types
grahamwell
 
Databases 101
Databases 101Databases 101
Databases 101
grahamwell
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
grahamwell
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and types
grahamwell
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
grahamwell
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
grahamwell
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
grahamwell
 
The rail fence
The rail fenceThe rail fence
The rail fence
grahamwell
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
grahamwell
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
grahamwell
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
grahamwell
 
Mtslesson
MtslessonMtslesson
Mtslesson
grahamwell
 

More from grahamwell (20)

Pseudocode
PseudocodePseudocode
Pseudocode
 
Excel =if function
Excel =if functionExcel =if function
Excel =if function
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
The software story
The software storyThe software story
The software story
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
 
Database field types
Database field typesDatabase field types
Database field types
 
Databases 101
Databases 101Databases 101
Databases 101
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and types
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
 
The rail fence
The rail fenceThe rail fence
The rail fence
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
 
Mtslesson
MtslessonMtslesson
Mtslesson
 

Rsa encryption

  • 2. R for Rivest, S for Shamir, and A for Adelman.
  • 3. Generating the public keys 1. Pick two prime numbers p and q, eg 3 and 11 2. Calculate their product n, n = 33 3. Calculate intermediate z (p-1)*(q-1), z = 20 4. Pick a prime k such that k is smaller than z and z is and not divisible by k, k = 7 5. The numbers n and k are the public key, in our case n=33, k=7
  • 4. Generating the private key • The private key j is given by the formula k * j = 1(mod z) • In our example, k = 7, z = 20 7 * j = 1(mod 20) • Is satisfied by j = 3 • Our private key is 3
  • 5. Encrypting and Decrypting • E is the encrypted value • P is the plaintext value • Encrypting, say we send P = 14 P ^ k = E(mod n) 14^7 = 105413504 105413504 / 33 = 3194348.606 14 ^ 7 = E(mod 33) = 20 3194348 * 33 = 105413484 105413504 – 105413484 = 20 • E ^ j = P(mod n) 20^3 = 8000 8000 / 33 = 242.42424242 • 20 ^ 3 = P(mod 33) = 14 242 * 33 = 7986 8000 – 7986 = 14
  • 6. Encrypting and Decrypting • E is the encrypted value • P is the plaintext value • Encrypting, say we send P = 14 P ^ k = E(mod n) 14^7 = 105413504 105413504 / 33 = 3194348.606 14 ^ 7 = E(mod 33) = 20 3194348 * 33 = 105413484 105413504 – 105413484 = 20 • E ^ j = P(mod n) 20^3 = 8000 8000 / 33 = 242.42424242 • 20 ^ 3 = P(mod 33) = 14 242 * 33 = 7986 8000 – 7986 = 14