SlideShare ist ein Scribd-Unternehmen logo
1 von 17
CHAPTER 13
 Asymmetric Key
 Cryptography
Slides adapted from "Foundations of Security: What Every Programmer
Needs To Know" by Neil Daswani, Christoph Kern, and Anita Kesavan
(ISBN 1590597842; http://www.foundationsofsecurity.com). Except as
otherwise noted, the content of this presentation is licensed under the
Creative Commons 3.0 License.
Agenda
   Problem with Symmetric Key Crypto: Alice &
    Bob have to agree on key!
   In 1970, Diffie & Hellman propose asymmetric or
    public key cryptography

   RSA & Elliptic Curve Cryptography (ECC)
   Certificate Authorities (CAs)
   Identity-Based Encryption (IBE)
   Authentication via Encryption
13.1. Why Asymmetric Key
Cryptography?
   So two strangers can talk privately on Internet

   Ex: Bob wants to talk to Alice & Carol secretly
     Insteadof sharing different pairs of secret keys with
      each (as in symmetric key crypto)
     Bob has 2 keys: public key and private (or secret) key

   Alice and Carol can send secrets to Bob
    encrypted with his public key
   Only Bob (with his secret key) can read them
13.1. … To Mess With Poor Eve




        Source: http://xkcd.com/177/
13.1. Public Key System


 Alice            Directory



 Carol



         Denise               Bob
13.1. The Public Key Treasure
Chest
   Public key = Chest with open lock
   Private key = Key to chest
   Treasure = Message
   Encrypting with public key
     Find chest with open lock
     Put a message in it
     Lock the chest
   Decrypting with private key
     Unlock lock with key
     Take contents out of the chest
13.1. Asymmetric Encryption
   Alice encrypts a message with different key
    than Bob uses to decrypt
   Bob has a public key, kp, and a secret key, ks.
    Bob’s public key is known to Alice.
   Asymmetric Cipher: F-1(F(m,kp),ks) = m
          Alice                           Bob
      1. Construct m
      2. Compute c= F(m,kp)
                              c
      3. Send c to Bob             4. Receive c from Alice
                                   5. Compute d=F-1(c,ks)
                                    6. m = d
13.2. RSA (1)
   Invented by Rivest/Shamir/Adelman (1978)
     First
          asymmetric encryption algorithm
     Most widely known public key cryptosystem

   Used in many protocols (e.g., SSL, PGP, …)

   Number theoretic algorithm: security based on
    difficulty of factoring large prime numbers
   1024, 2048, 4096-bit keys common
13.2. RSA (2)
   Public Key Parameters:
     Largecomposite number n with two prime factors
     Encryption exponent e coprime to φ(n) = (p-1)(q-1)
   Private Key:
     Factors of n: p, q (n = pq)
     Decryption exponent d such that ed ´ 1 (mod φ(n))


   Encryption: Alice sends c = me mod n
   Decryption: Bob computes m = cd mod n
     Euler’sTheorem: aφ(n) ´ 1 (mod n)
     Check: med ´ m ¢ mφ(n) ´ m (mod n)
13.3. Elliptic Curve
Cryptography
   Invented by N. Koblitz & V. Miller (1985)

   Based on hardness of elliptic curve discrete log
    problem
   Standardized by NIST, ANSI, IEEE for
    government, financial use
   Certicom, Inc. currently holds patent

   Small keys: 163 bits (<< 1024-bit RSA keys)
13.3: RSA vs. ECC
   RSA Advantages:
     Has been around longer; math well-understood
     Patent expired; royalty free
     Faster encryption



   ECC Advantages:
     Shorter key size
     Fast key generation (no primality testing)
     Faster decryption
13.4. Symmetric vs. Asymmetric
Key Cryptography
   Symmetric-Crypto (DES, 3DES, AES)
     Efficient(smaller keys / faster encryption) because
      of simpler operations (e.g. discrete log)
     Key agreement problem
     Online


   Asymmetric-Crypto (RSA, ECC)
     RSA   1000x slower than DES, more complicated
      operations (e.g. modular exponentiation)
     How to publish public keys? Requires PKI / CAs
     Offline or Online
13.5. Certificate Authorities
   Trusted third party: CA verifies people’s identities
   Authenticates Bob & creates public key
    certificate (binds Bob’s identity to his public key)

   CA also revokes keys and certificates
   Certificate Revocation List: compromised keys

   Public Key Infrastructure (PKI): CA + everything
    required for public key encryption
13.6. Identity-Based Encryption
   Ex: e-mail address as identity & public key
   Bob gets his private key from a generator (PKG)
    after authenticating himself via a CA

   Commercialized by Voltage Security (2002)
   Revoked Keys: concatenate current date to
    public key
   Then PKG doesn’t provide private key after date
    when compromised
13.7. Authentication with
Encryption
   Alice issues “challenge” message to person
     Random    # (nonce) encrypted with Bob’s public key
     If person is actually Bob, he will be able to decrypt it


                 {384764342}PK(Bob)                       Bob

                      384764342
       Alic
       e
                                                           Eve
                 {957362353}PK(Bob)
                                                         ???
A Word of Caution
   In the previous example, as well as some other
    examples presented in later chapters, the simple toy
    protocols that we discuss are for instructive and
    illustration purposes only. They are designed to make
    concepts easy to understand, and are vulnerable to
    various types of attacks that we do not necessarily
    describe. Do not implement these protocols as is in
    software.

   For example, the simple “challenge” authentication
    method is vulnerable to a man-in-the-middle attack.
     Mallory gets a challenge from Alice, sends it to Bob
     She takes his response and returns it to Alice
     Bob needs to authenticate Alice as well
Summary
   Asymmetric Cryptography: Two Keys
     Publickey published in directory
     Secret key known only to Bob
     Solves key exchange problem


   Examples: RSA, ECC

   PKI required: CAs, Trusted Third Parties

   Applications: IBE, Authentication, SSL…

Weitere ähnliche Inhalte

Was ist angesagt?

Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & SteganographyAnimesh Shaw
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMACKrishna Gehlot
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network SecurityPa Van Tanku
 
Information and network security 13 playfair cipher
Information and network security 13 playfair cipherInformation and network security 13 playfair cipher
Information and network security 13 playfair cipherVaibhav Khanna
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentationMahmoud Ibra
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptographydrewz lin
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security ArchitectureBharathiKrishna6
 
Cryptography and Network Lecture Notes
Cryptography and Network Lecture NotesCryptography and Network Lecture Notes
Cryptography and Network Lecture NotesFellowBuddy.com
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
6. cryptography
6. cryptography6. cryptography
6. cryptography7wounders
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
 

Was ist angesagt? (20)

Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
Information and network security 13 playfair cipher
Information and network security 13 playfair cipherInformation and network security 13 playfair cipher
Information and network security 13 playfair cipher
 
Cryptography
CryptographyCryptography
Cryptography
 
Hash Function
Hash FunctionHash Function
Hash Function
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
12 symmetric key cryptography
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptography
 
Elgamal &amp; schnorr digital signature scheme copy
Elgamal &amp; schnorr digital signature scheme   copyElgamal &amp; schnorr digital signature scheme   copy
Elgamal &amp; schnorr digital signature scheme copy
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Encryption and Key Distribution Methods
Encryption and Key Distribution MethodsEncryption and Key Distribution Methods
Encryption and Key Distribution Methods
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
Cryptography and Network Lecture Notes
Cryptography and Network Lecture NotesCryptography and Network Lecture Notes
Cryptography and Network Lecture Notes
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
6. cryptography
6. cryptography6. cryptography
6. cryptography
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 

Ähnlich wie Asymmetric Cryptography Explained: Public Keys, RSA, ECC

aacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxaacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxImXaib
 
computer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationcomputer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationAlex Punnen
 
Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Sri Prasanna
 
Network Security
Network SecurityNetwork Security
Network Securityhj43us
 
Cryptography for developers
Cryptography for developersCryptography for developers
Cryptography for developersKai Koenig
 
Part04 key exchange protocols
Part04 key exchange protocolsPart04 key exchange protocols
Part04 key exchange protocolsLê Liêu
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2Tutun Juhana
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.pptMIBrand
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.pptShounakDas16
 
A TLS Story
A TLS StoryA TLS Story
A TLS Storyereddick
 
Secure Obfuscation for Encrypted Signatures
Secure Obfuscation for Encrypted SignaturesSecure Obfuscation for Encrypted Signatures
Secure Obfuscation for Encrypted SignaturesSatoshi Hada
 
Us 17-radocea-intercepting-i cloud-keychain
Us 17-radocea-intercepting-i cloud-keychainUs 17-radocea-intercepting-i cloud-keychain
Us 17-radocea-intercepting-i cloud-keychainAlex Radocea
 
rsa.pdf
rsa.pdfrsa.pdf
rsa.pdfBuCu3
 

Ähnlich wie Asymmetric Cryptography Explained: Public Keys, RSA, ECC (20)

1329 n 9460
1329 n 94601329 n 9460
1329 n 9460
 
aacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptxaacyberessential3cryptography-131067585699078884.pptx
aacyberessential3cryptography-131067585699078884.pptx
 
Ch7 2ed
Ch7 2edCh7 2ed
Ch7 2ed
 
computer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentationcomputer-security-and-cryptography-a-simple-presentation
computer-security-and-cryptography-a-simple-presentation
 
Internet security
Internet securityInternet security
Internet security
 
Secure Communication (Distributed computing)
Secure Communication (Distributed computing)Secure Communication (Distributed computing)
Secure Communication (Distributed computing)
 
Network Security
Network SecurityNetwork Security
Network Security
 
Cryptography for developers
Cryptography for developersCryptography for developers
Cryptography for developers
 
Part04 key exchange protocols
Part04 key exchange protocolsPart04 key exchange protocols
Part04 key exchange protocols
 
ET4045-2-cryptography-2
ET4045-2-cryptography-2ET4045-2-cryptography-2
ET4045-2-cryptography-2
 
b
bb
b
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
 
network security
network security network security
network security
 
A TLS Story
A TLS StoryA TLS Story
A TLS Story
 
security
securitysecurity
security
 
Secure Obfuscation for Encrypted Signatures
Secure Obfuscation for Encrypted SignaturesSecure Obfuscation for Encrypted Signatures
Secure Obfuscation for Encrypted Signatures
 
Us 17-radocea-intercepting-i cloud-keychain
Us 17-radocea-intercepting-i cloud-keychainUs 17-radocea-intercepting-i cloud-keychain
Us 17-radocea-intercepting-i cloud-keychain
 
rsa.pdf
rsa.pdfrsa.pdf
rsa.pdf
 
Crypt
CryptCrypt
Crypt
 

Mehr von drewz lin

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearydrewz lin
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013drewz lin
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13drewz lin
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrichdrewz lin
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2drewz lin
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2drewz lin
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfdrewz lin
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equaldrewz lin
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21drewz lin
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansendrewz lin
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaoladrewz lin
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsdrewz lin
 
Appsec2013 presentation
Appsec2013 presentationAppsec2013 presentation
Appsec2013 presentationdrewz lin
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsdrewz lin
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martindrewz lin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowaspdrewz lin
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usadrewz lin
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013drewz lin
 
基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架drewz lin
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈drewz lin
 

Mehr von drewz lin (20)

Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-keary
 
Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013Via forensics appsecusa-nov-2013
Via forensics appsecusa-nov-2013
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrich
 
Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2Owasp advanced mobile-application-code-review-techniques-v0.2
Owasp advanced mobile-application-code-review-techniques-v0.2
 
I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2I mas appsecusa-nov13-v2
I mas appsecusa-nov13-v2
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
 
Csrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equalCsrf not-all-defenses-are-created-equal
Csrf not-all-defenses-are-created-equal
 
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
Chuck willis-owaspbwa-beyond-1.0-app secusa-2013-11-21
 
Appsec usa roberthansen
Appsec usa roberthansenAppsec usa roberthansen
Appsec usa roberthansen
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
 
Appsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_editsAppsec2013 presentation-dickson final-with_all_final_edits
Appsec2013 presentation-dickson final-with_all_final_edits
 
Appsec2013 presentation
Appsec2013 presentationAppsec2013 presentation
Appsec2013 presentation
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
 
Appsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martinAppsec2013 assurance tagging-robert martin
Appsec2013 assurance tagging-robert martin
 
Amol scadaowasp
Amol scadaowaspAmol scadaowasp
Amol scadaowasp
 
Agile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usaAgile sdlc-v1.1-owasp-app sec-usa
Agile sdlc-v1.1-owasp-app sec-usa
 
Vulnex app secusa2013
Vulnex app secusa2013Vulnex app secusa2013
Vulnex app secusa2013
 
基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架基于虚拟化技术的分布式软件测试框架
基于虚拟化技术的分布式软件测试框架
 
新浪微博稳定性经验谈
新浪微博稳定性经验谈新浪微博稳定性经验谈
新浪微博稳定性经验谈
 

Asymmetric Cryptography Explained: Public Keys, RSA, ECC

  • 1. CHAPTER 13 Asymmetric Key Cryptography Slides adapted from "Foundations of Security: What Every Programmer Needs To Know" by Neil Daswani, Christoph Kern, and Anita Kesavan (ISBN 1590597842; http://www.foundationsofsecurity.com). Except as otherwise noted, the content of this presentation is licensed under the Creative Commons 3.0 License.
  • 2. Agenda  Problem with Symmetric Key Crypto: Alice & Bob have to agree on key!  In 1970, Diffie & Hellman propose asymmetric or public key cryptography  RSA & Elliptic Curve Cryptography (ECC)  Certificate Authorities (CAs)  Identity-Based Encryption (IBE)  Authentication via Encryption
  • 3. 13.1. Why Asymmetric Key Cryptography?  So two strangers can talk privately on Internet  Ex: Bob wants to talk to Alice & Carol secretly  Insteadof sharing different pairs of secret keys with each (as in symmetric key crypto)  Bob has 2 keys: public key and private (or secret) key  Alice and Carol can send secrets to Bob encrypted with his public key  Only Bob (with his secret key) can read them
  • 4. 13.1. … To Mess With Poor Eve Source: http://xkcd.com/177/
  • 5. 13.1. Public Key System Alice Directory Carol Denise Bob
  • 6. 13.1. The Public Key Treasure Chest  Public key = Chest with open lock  Private key = Key to chest  Treasure = Message  Encrypting with public key  Find chest with open lock  Put a message in it  Lock the chest  Decrypting with private key  Unlock lock with key  Take contents out of the chest
  • 7. 13.1. Asymmetric Encryption  Alice encrypts a message with different key than Bob uses to decrypt  Bob has a public key, kp, and a secret key, ks. Bob’s public key is known to Alice.  Asymmetric Cipher: F-1(F(m,kp),ks) = m Alice Bob 1. Construct m 2. Compute c= F(m,kp) c 3. Send c to Bob 4. Receive c from Alice 5. Compute d=F-1(c,ks) 6. m = d
  • 8. 13.2. RSA (1)  Invented by Rivest/Shamir/Adelman (1978)  First asymmetric encryption algorithm  Most widely known public key cryptosystem  Used in many protocols (e.g., SSL, PGP, …)  Number theoretic algorithm: security based on difficulty of factoring large prime numbers  1024, 2048, 4096-bit keys common
  • 9. 13.2. RSA (2)  Public Key Parameters:  Largecomposite number n with two prime factors  Encryption exponent e coprime to φ(n) = (p-1)(q-1)  Private Key:  Factors of n: p, q (n = pq)  Decryption exponent d such that ed ´ 1 (mod φ(n))  Encryption: Alice sends c = me mod n  Decryption: Bob computes m = cd mod n  Euler’sTheorem: aφ(n) ´ 1 (mod n)  Check: med ´ m ¢ mφ(n) ´ m (mod n)
  • 10. 13.3. Elliptic Curve Cryptography  Invented by N. Koblitz & V. Miller (1985)  Based on hardness of elliptic curve discrete log problem  Standardized by NIST, ANSI, IEEE for government, financial use  Certicom, Inc. currently holds patent  Small keys: 163 bits (<< 1024-bit RSA keys)
  • 11. 13.3: RSA vs. ECC  RSA Advantages:  Has been around longer; math well-understood  Patent expired; royalty free  Faster encryption  ECC Advantages:  Shorter key size  Fast key generation (no primality testing)  Faster decryption
  • 12. 13.4. Symmetric vs. Asymmetric Key Cryptography  Symmetric-Crypto (DES, 3DES, AES)  Efficient(smaller keys / faster encryption) because of simpler operations (e.g. discrete log)  Key agreement problem  Online  Asymmetric-Crypto (RSA, ECC)  RSA 1000x slower than DES, more complicated operations (e.g. modular exponentiation)  How to publish public keys? Requires PKI / CAs  Offline or Online
  • 13. 13.5. Certificate Authorities  Trusted third party: CA verifies people’s identities  Authenticates Bob & creates public key certificate (binds Bob’s identity to his public key)  CA also revokes keys and certificates  Certificate Revocation List: compromised keys  Public Key Infrastructure (PKI): CA + everything required for public key encryption
  • 14. 13.6. Identity-Based Encryption  Ex: e-mail address as identity & public key  Bob gets his private key from a generator (PKG) after authenticating himself via a CA  Commercialized by Voltage Security (2002)  Revoked Keys: concatenate current date to public key  Then PKG doesn’t provide private key after date when compromised
  • 15. 13.7. Authentication with Encryption  Alice issues “challenge” message to person  Random # (nonce) encrypted with Bob’s public key  If person is actually Bob, he will be able to decrypt it {384764342}PK(Bob) Bob 384764342 Alic e Eve {957362353}PK(Bob) ???
  • 16. A Word of Caution  In the previous example, as well as some other examples presented in later chapters, the simple toy protocols that we discuss are for instructive and illustration purposes only. They are designed to make concepts easy to understand, and are vulnerable to various types of attacks that we do not necessarily describe. Do not implement these protocols as is in software.  For example, the simple “challenge” authentication method is vulnerable to a man-in-the-middle attack.  Mallory gets a challenge from Alice, sends it to Bob  She takes his response and returns it to Alice  Bob needs to authenticate Alice as well
  • 17. Summary  Asymmetric Cryptography: Two Keys  Publickey published in directory  Secret key known only to Bob  Solves key exchange problem  Examples: RSA, ECC  PKI required: CAs, Trusted Third Parties  Applications: IBE, Authentication, SSL…

Hinweis der Redaktion

  1. Welcome to SEC103 on Secure Programming Techniques. In this course, I assume that you have some background in computer security, but now you want to put that background to use. For example, in the Computer Security Principles and Introduction To Cryptography courses, we cover topics such concerning trust and encryption. In this course, we put these principles into to practice, and I’ll show you have to write secure code that builds security into your applications from the ground up.
  2. Another way to think of asymmetric encryption is as follows. When Bob gives out his public key, it is like him giving out an open, empty treasure chest. Anyone can put a message in the treasure chest and lock the treasure chest. However, Bob is the only one that can open the treasure chest because his private key is the key to the treasure chest.
  3. In this slide, we summarize how asymmetric cryptography works. If Alice wants to send a secret message to Bob, she first constructs her message, M. She then computes a ciphertext, C, using an asymmetric encryption scheme that takes the message to be encrypted and Bob’s public key as input. Remember that Bob’s public key is public and can be published in a directory so that is how Alice knows Bob’s public key. Alice sends the ciphertext to Bob. When Bob receives the ciphertext, he feeds the ciphertext and his private key to an asymmetric decryption algorithm to recover the message.
  4. After briefly introducing how symmetric ciphers in the last lecture, we talked about some examples of symmetric ciphers such as DES and AES. Now that we have talked about how asymmetric ciphers work in general, we will talk about two examples of them; namely, RSA and ECC. RSA is the first asymmetric encryption algorithm that we ever developed. Shortly after Diffie and Hellman published a paper about the idea of an asymmetric cipher, Rivest, Shamir, and Adelman, the R, S, and A, in RSA came up with an implementation of the idea. Even today, RSA is the most widely known and used asymmetric cipher. It is used in protocols such as SSL, CDPD, WTLS, PGP, and many others. SSL used for secure communication between web browsers and servers, we have already met. CDPD stands for Cellular Digital Packet Data, and it is a wireless data protocol. WTLS stands for Wireless Transport Layer security, and it is SSLs analog in the wireless web. So you get the point– RSA is widely used in many other protocols. The mathematical properties of the RSA algorithm are based on number theory, and we will go through a very high level overview of how it works in just a second. Its security of the algorithm depends on the difficulty of factoring large prime numbers. If it is difficult the factor large prime factors, it will be hard to break the mathematical properties of the algorithm. Common key sizes that are used with RSA are 1024, 2048, and 4096 bits. Keep in mind that since RSA is different than any other algorithm, these key sizes have not have a direct relation to the key sizes of symmetric algorithms (or even other asymmetric algorithms). That is, just because we might encrypt message with a 1024-bit RSA key, that does not mean that it is more or less “secure” in any way than encrypting a message using a 256-bit AES key. We can compare the strength of key sizes of different algorithms by measuring the expected amount of time it would take to successfully conduct a brute force attack on them, but in general it does not make much sense to directly compare the lengths of keys of two different algorithms.
  5. Elliptic curve cryptography provides yet another way to build a public key cryptosystem. It was invented to by Neil Koblitz and Victor Miller independently at about the same time in 1985. Its discovery is much more recent than RSA. Elliptic curve cryptography is also based on number theory. Its security is not dependent upon the difficulty of factoring large prime numbers, but instead is based upon the difficulty of the elliptic curve discrete log problem. Since RSA has been around longer than ECC and mathematicians have had more time to look at attacks on RSA, we might say that RSA is more well understood than ECC. Nevertheless, ECC has started making an impact in real-world security systems, and that is why we mention it here. For example, ECC public-key crypto has been incorporated into WTLS, a wireless version of the SSL protocol. Since the mathematics of ECC are more complicated than that of RSA, were not going to cover them here, but you can consult Stallings if you are interested. The key thing to know about ECC-based public key crypto from a systems standpoint is that it allows us to do public key operations using must smaller keys than RSA allows us to do the same operations. Studies have been done which estimate that a 163-bit RSA is comparable in strength to a 1024-bit RSA key from the standpoint that it might take an attacker about the same amount of time to conduct a brute force attack on a 163-bit ECC key as it would take the attacker to conduct a brute force attack on a 1024-bit RSA key. Due to the smaller key sizes, ECC has some advantages over RSA for certain types of applications, such as wireless applications since wireless devices usually have less memory and computing resources than desktop PCs. A public company by the name of Certicom currently holds the patent for ECC-based public key crypto. As a result of the smaller key sizes, Unlike RSA, however, the security of the elliptic curve public-key cryptosystem is based on the difficulty of the discrete log problem, as opposed to the difficulty of factoring. What is the public key and what is the private key? More information on ECC at www.certicom.com http://www.certicom.com/resources/download/EccWhite3.pdf
  6. What are the key differences between RSA and ECC? Well, as we mentioned earlier, since RSA has been around earlier, it is probably more well-understood than ECC. RSA also used to be held under a patent by RSA Data Security, but that patent expired on September 20, 2000 so RSA can be used royalty free. However, you will still need to pay royalties to Certicom, Inc. if you want to use ECC. The third advantage that RSA provides, in general, faster encryption for a comparable key strength. (Usually, a small public key exponent such as e=3 or e=65537 is used with RSA because it makes verifying digital signatures very fast. We will talk about digital signatures shortly.) Looking at ECC, we see that its advantages are: a shorter key size for comparable cryptographic strength. In order to use public key crypto, a user first needs to generate a public/private key pair that satisfies certain mathematical properties. For RSA, we needed to find two large prime numbers that we could multiply together to “set up” the system. Remember, in RSA all operations we done mod n where n was the product of these two large primes. However, checking that a number that is thousands of digits long it not easy. (That is, it takes a while!) Since ECC public key systems do not require that we use such large prime numbers, we do not have to do this primality checking. As a result, generating public-private key pairs for new users is much faster with ECC. Finally, ECC allows us to do decryption faster than RSA for comparable key strength. For more info about the trade-offs between RSA and ECC, you may consult two research papers that were written by yours truly on my web site. Double check faster encryption faster / decryption business
  7. Until this point, we have looked at all keys as being encryption keys. That is, whether we were talking about a symmetric encryption algorithm or an asymmetric encryption algorithm, DES or RSA, we talked about using a key of the appropriate length to do encryption or decryption. The most obvious application of encryption is to achieve confidentiality. However, encryption can be used for other applications as well. For example, we can use encryption to do authentication. This is how we would do it with a public key cryptosystem. If I believe that only Bob will have Bob’s private key, then if I want to check whether or not I am really communicating with Bob, I can encrypt a “challenge” message using Bob’s public key. The challenge message is just a regular message that might say something like “If you can read this, then say ‘BOO’!” If the person on the other end of the communication is able to read the message it must be cause that person has possession of Bob’s private key, and the person should respond by sending you the message “Boo!” If we believe that Bob is responsible, and has not given his private key to anybody else, and that Bob is also smart enough to have his systems protected so that his private key was not stolen, then we have the right to believe that we are actually communicating with Bob. Hence, we just used public-key encryption to authenticate Bob. That is, we used the public key encryption scheme to check that we are actually talking to Bob and nobody else.