Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime...
Transcript of Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime...
![Page 1: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/1.jpg)
Chapter4:PublicKey Basics RSA(FactorizingPrimes) EllipticCurve(EllipticCurves)ElGamal(DiscreteLogs) ProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption
![Page 2: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/2.jpg)
PublicKeyMethods
![Page 3: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/3.jpg)
PublicKeyMethods
• IntegerFactorization.Usingprimenumbers.Example:RSA.DigitalCerts/SSL.
• DiscreteLogarithms.Y=GxmodP.Example:ElGamal.
• EllipticCurveRelationships.Example:EllipticCurve.SmartCards,IoT,Tor,Bitcoin.
![Page 4: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/4.jpg)
PublicKeyMethods
• IntegerFactorization.Usingprimenumbers.Example:RSA.DigitalCerts/SSL.
• DiscreteLogarithms.Y=GxmodP.Example:ElGamal.
• EllipticCurveRelationships.Example:EllipticCurve.SmartCards,IoT,Tor,Bitcoin.
![Page 5: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/5.jpg)
PublicKeyMethods
• IntegerFactorization.Usingprimenumbers.Example:RSA.DigitalCerts/SSL.
• DiscreteLogarithms.Y=GxmodP.Example:ElGamal.
• EllipticCurveRelationships.Example:EllipticCurve.SmartCards,IoT,Tor,Bitcoin.
![Page 6: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/6.jpg)
Chapter4:PublicKey RSAProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption
![Page 7: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/7.jpg)
![Page 8: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/8.jpg)
![Page 9: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/9.jpg)
RSA
• Twoprimesp,q.• CalculateN(modulus)aspxqeg3
and11.n=33.• CalculatePHIas(p-1)x(q-1).PHI=20• Selectefornocommonfactorwith
PHI.e=3.• Encryptionkey[e,n]or[3,33].• (dxe)mod20=1• (dx3)mod20=1• d=7• Decryptionkey[d,n]or[7,33]
![Page 10: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/10.jpg)
RSA• Encryptionkey[e,n]or[3,33].• Decryptionkey[d,n]or[7,33]• Cipher=MemodNegM=5.• Cipher=53mod33=26• Decipher=CdmodN• Decipher=(26)7mod33=5
Example
Calc
![Page 11: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/11.jpg)
Chapter4:PublicKey EllipticCurveProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption
![Page 12: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/12.jpg)
EllipticCurve(EC)• Pickapointontheellipticcurve(G).• Generatearandomnumber(n)–thiswillbetheprivatekey.
• PublickeyisP=nxG(modp),wherepisaprimenumber(eg256-bitprimeforCurve25519).
• nisascalarvaluewhichmultipleswithGtogiveP(publickey)
• Bitcoinusessecp256k1andTorusesCurve25519[here].
![Page 13: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/13.jpg)
BitcoinKeyGeneration
![Page 14: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/14.jpg)
BitcoinTransaction
![Page 15: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/15.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
Example
![Page 16: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/16.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
Example
![Page 17: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/17.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
C\>opensslec-inpriv.pem-text-nooutreadECkeyPrivate-Key(256bit)priv46b9e861b63d3509c88b7817275a30d22d62c8cd8fa6486ddee35ef0d8e0495fpub042500e7f3fbddf2842903f544ddc87494ce95029ace4e257d54ba77f2bc1f3a8837a9461c4f1c57fecc499753381e772a128a5820a924a2fa05162eb662987a9fASN1OIDsecp256k1
Example
![Page 18: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/18.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
Example
![Page 19: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/19.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
C\>opensslec-inpriv.pem-text-nooutreadECkeyPrivate-Key(256bit)priv46b9e861b63d3509c88b7817275a30d22d62c8cd8fa6486ddee35ef0d8e0495fpub042500e7f3fbddf2842903f544ddc87494ce95029ace4e257d54ba77f2bc1f3a8837a9461c4f1c57fecc499753381e772a128a5820a924a2fa05162eb662987a9fASN1OIDsecp256k1
Example
![Page 20: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/20.jpg)
EllipticCurve(EC)C\>opensslecparam-namesecp256k1-genkey-outpriv.pem
C\>typeec-priv.pem-----BEGINECPARAMETERS-----BgUrgQQACg==-----ENDECPARAMETERS----------BEGINECPRIVATEKEY-----MHQCAQEEIEa56GG2PTUJyIt4FydaMNItYsjNj6ZIbd7jXvDY4ElfoAcGBSuBBAAKoUQDQgAEJQDn8/vd8oQpA/VE3ch0lM6VAprOTiV9VLp38rwfOog3qUYcTxxX/sxJl1M4HncqEopYIKkkovoFFi62Yph6nw==-----ENDECPRIVATEKEY-----
C\>opensslec-inpriv.pem-text-nooutreadECkeyPrivate-Key(256bit)priv46b9e861b63d3509c88b7817275a30d22d62c8cd8fa6486ddee35ef0d8e0495fpub042500e7f3fbddf2842903f544ddc87494ce95029ace4e257d54ba77f2bc1f3a8837a9461c4f1c57fecc499753381e772a128a5820a924a2fa05162eb662987a9fASN1OIDsecp256k1
Example C:>opensslecparam-inpriv.pem-text-param_encexplicit-nooutFieldType:prime-fieldPrime:00:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:fe:ff:ff:fc:2fA:0B:7(0x7)Generator(uncompressed):04:79:be:66:7e:f9:dc:bb:ac:55:a0:62:95:ce:87:0b:07:02:9b:fc:db:2d:ce:28:d9:59:f2:81:5b:16:f8:17:98:48:3a:da:77:26:a3:c4:65:5d:a4:fb:fc:0e:11:08:a8:fd:17:b4:48:a6:85:54:19:9c:47:d0:8f:fb:10:d4:b8Order:00:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:fe:ba:ae:dc:e6:af:48:a0:3b:bf:d2:5e:8c:d0:36:41:41Cofactor:1(0x1)
![Page 21: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/21.jpg)
EllipticCurveDiffieHellman(ECDH)
![Page 22: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/22.jpg)
EllipticCurveDiffieHellman(ECDH)
![Page 23: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/23.jpg)
EllipticCurveDiffieHellman(ECDH)
![Page 24: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/24.jpg)
Chapter4:PublicKey ElGamal ProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption
![Page 25: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/25.jpg)
ElGamal
• Y=Gxmodp• Gispickedfromcyclicgroup
(ExplainedinKeyHandshakingsection).Here.
• pisaprimenumber.• Examplehere.
![Page 26: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/26.jpg)
Chapter4:PublicKey PGP ProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption
![Page 27: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/27.jpg)
PGP
![Page 28: Chapter 4: Public Key · 2019. 2. 28. · Public Key Methods • Integer Factorization.Using prime numbers. Example: RSA. Digital Certs/SSL. • Discrete Logarithms.Y = Gx mod P.](https://reader036.fdocuments.in/reader036/viewer/2022071110/5fe5a13f3e066176752168cd/html5/thumbnails/28.jpg)
Chapter4:PublicKey Basics RSAEllipticCurveElGamal ProfBillBuchananOBE http://asecuritysite.com/crypto04http://asecuritysite.com/encryption