SlideShare ist ein Scribd-Unternehmen logo
1 von 6
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

Weitere ähnliche Inhalte

Was ist angesagt?

Graficas de trigo
Graficas de trigoGraficas de trigo
Graficas de trigogemelo69
 
Funciones1
Funciones1Funciones1
Funciones1Ray 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 reviewldaneau
 
Tarea de informatica
Tarea de informaticaTarea de informatica
Tarea de informaticabrylejo
 
Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)Chapter 1 test corrections (algebra)
Chapter 1 test corrections (algebra)Algebra / Mathematics
 
Java Polymorphism
Java PolymorphismJava Polymorphism
Java PolymorphismAathikaJava
 
A1 factoring gcm and grouping
A1   factoring gcm and groupingA1   factoring gcm and grouping
A1 factoring gcm and groupingNara Cocarelli
 
Metodologia de la programación - expresiones
Metodologia de la programación - expresionesMetodologia de la programación - expresiones
Metodologia de la programación - expresionesMar_Angeles
 
Factoring difference of squares
Factoring difference of squaresFactoring difference of squares
Factoring difference of squaresbrittanyhurley1
 

Was ist angesagt? (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
 

Andere mochten auch (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
 

Ähnlich wie Rsa encryption

OpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングOpenOpt の線形計画で圧縮センシング
OpenOpt の線形計画で圧縮センシングToshihiro Kamishima
 
5indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp025indiceslogarithms 120909011915-phpapp02
5indiceslogarithms 120909011915-phpapp02Sofia Mahmood
 
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 mapsMathieu Dutour Sikiric
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahumaralfaruqi
 
Spm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahSpm trial-2012-addmath-qa-kedah
Spm trial-2012-addmath-qa-kedahRuzita Kamil
 
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.pdfRajuSingh806014
 
workbook_full_solutions_2.pdf
workbook_full_solutions_2.pdfworkbook_full_solutions_2.pdf
workbook_full_solutions_2.pdfZiaSethi1
 
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.pdfRajuSingh806014
 

Ähnlich wie 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
 

Mehr von grahamwell

Excel =if function
Excel =if functionExcel =if function
Excel =if functiongrahamwell
 
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 developgrahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch developgrahamwell
 
The software story
The software storyThe software story
The software storygrahamwell
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphicsgrahamwell
 
Database field types
Database field typesDatabase field types
Database field typesgrahamwell
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and typesgrahamwell
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and typesgrahamwell
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9grahamwell
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your projectgrahamwell
 
The rail fence
The rail fenceThe rail fence
The rail fencegrahamwell
 
Server side scripts
Server side scriptsServer side scripts
Server side scriptsgrahamwell
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and controlgrahamwell
 

Mehr von 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