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

DOCX
Grafias 1
DOCX
Ecs.log.ii parte.3ºsec.
PDF
Notes 3-7
DOC
Revision test 1
PPTX
Square of binomial
PPSX
PDF
Ch20 20
PPTX
Class 9th ch 2 polynomials quiz
Grafias 1
Ecs.log.ii parte.3ºsec.
Notes 3-7
Revision test 1
Square of binomial
Ch20 20
Class 9th ch 2 polynomials quiz

What's hot (18)

DOCX
Graficas de trigo
PDF
Querying solr
DOC
Funciones1
DOC
Algebra i ccp quarter 1 benchmark review
DOCX
Tarea de informatica
PPTX
Chapter 1 test corrections (algebra)
DOCX
Math basic2
PDF
Maria
PDF
6TH-ADV-CH01-RATIONAL NUMBERS
PDF
Assignment6
PPTX
Java Polymorphism
PPTX
A1 factoring gcm and grouping
DOCX
Module of integer exponents
PPTX
Feb.27
DOCX
Calculo 4,5
PDF
Matlab file
PDF
Metodologia de la programación - expresiones
PPTX
Factoring difference of squares
Graficas de trigo
Querying solr
Funciones1
Algebra i ccp quarter 1 benchmark review
Tarea de informatica
Chapter 1 test corrections (algebra)
Math basic2
Maria
6TH-ADV-CH01-RATIONAL NUMBERS
Assignment6
Java Polymorphism
A1 factoring gcm and grouping
Module of integer exponents
Feb.27
Calculo 4,5
Matlab file
Metodologia de la programación - expresiones
Factoring difference of squares
Ad

Viewers also liked (8)

PPTX
PPTX
Cryptography
PPT
PPTX
RSA algorithm
PDF
RSA ALGORITHM
PPT
Public Key Cryptography and RSA algorithm
Cryptography
RSA algorithm
RSA ALGORITHM
Public Key Cryptography and RSA algorithm
Ad

Similar to Rsa encryption (15)

DOC
Question 6
PDF
LaplaceTransformIIT.pdf
PPT
PDF
OpenOpt の線形計画で圧縮センシング
PDF
5indiceslogarithms 120909011915-phpapp02
PDF
Taller de Mecanica Calsica
PDF
Goldberg-Coxeter construction for 3- or 4-valent plane maps
PDF
Spm trial-2012-addmath-qa-kedah
PDF
Spm trial-2012-addmath-qa-kedah
PDF
2. Definite Int. Theory Module-5.pdf
PPTX
Integral
PDF
metodos_abreviados de ecuciones diferenciales
PDF
metodos_abreviados.ecuaciones diferenciales
PDF
workbook_full_solutions_2.pdf
PDF
01. Differentiation-Theory & solved example Module-3.pdf
Question 6
LaplaceTransformIIT.pdf
OpenOpt の線形計画で圧縮センシング
5indiceslogarithms 120909011915-phpapp02
Taller de Mecanica Calsica
Goldberg-Coxeter construction for 3- or 4-valent plane maps
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedah
2. Definite Int. Theory Module-5.pdf
Integral
metodos_abreviados de ecuciones diferenciales
metodos_abreviados.ecuaciones diferenciales
workbook_full_solutions_2.pdf
01. Differentiation-Theory & solved example Module-3.pdf

More from grahamwell (20)

PPTX
Pseudocode
PPT
Excel =if function
PPT
Excel Min max-average
PPTX
What is binary and why do we use it?
PPTX
Introduction to touch develop
PPTX
Introduction to touch develop
PPTX
The software story
PPTX
Turtle graphics
PPTX
Database field types
PPTX
Databases 101
PPTX
Kodu controls
PPT
Pascal names and types
PPT
Python part two names and types
PPTX
Abstraction - Year 9
PPTX
Thinking about your project
PPTX
The rail fence
PPT
Lesson 1
PPT
Server side scripts
PPTX
Revision topic 1 sensors and control
PPTX
Mtslesson
Pseudocode
Excel =if function
Excel Min max-average
What is binary and why do we use it?
Introduction to touch develop
Introduction to touch develop
The software story
Turtle graphics
Database field types
Databases 101
Kodu controls
Pascal names and types
Python part two names and types
Abstraction - Year 9
Thinking about your project
The rail fence
Lesson 1
Server side scripts
Revision topic 1 sensors and control
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