SlideShare a Scribd company logo
1 of 155
Alice & Bob
    Public key cryptography 101


    Loadays - 16 & 17 april 2011
    Antwerp - Belgium




http://joind.in/3305
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Development in PHP, Python, Perl,
C, Java....

Blogs: http://www.adayinthelifeof.nl
       http://www.enrise.com/blog

Email: joshua@enrise.com
Twitter: @jaytaph
Identi.ca: jaytaph
What are we discussing?




‣ An introduction into public key encryption
‣ But first of all...
‣ Who are Alice and Bob???
Terminology (1)
Terminology (1)



       Meet Alice,
                     and Bob.
Terminology (2)




    Fictional characters who are representing
    either side of the (communication) line.
    Person A(lice) is sending a message to
    person B(ob).
Terminology (3)




http://labs.google.com/sets?hl=en&q1=plaintext&q2=ciphertext&q3=cipher&q4=deterministic&q5=rsa&btn=Large+Set
http://www.wordle.net/create
Encryption history




               Before we look at
               good encryptions,
               let’s take a look at
               some bad ones...




http://www.flickr.com/photos/wwworks/4612188594/sizes/m/in/photostream/
Encryption history (1)



                   “algorithm”:
          A = 1, B = 2, C = 3, ...., Z = 26




‣ SUBSTITUTION SCHEME
Encryption history (1)



                   “algorithm”:
          A = 1, B = 2, C = 3, ...., Z = 26

                Encrypted message:
                     12,1,13,5



‣ SUBSTITUTION SCHEME
Encryption history (1)



                   “algorithm”:
          A = 1, B = 2, C = 3, ...., Z = 26

                Encrypted message:
                     12,1,13,5
                         =
                      L,A,M,E

‣ SUBSTITUTION SCHEME
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:
    m = m + k mod 26




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26
                           Ciphertext (key=1): M B N F




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26
                           Ciphertext (key=1): M B N F
                           Ciphertext (key=-1): K Z L D




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26
                           Ciphertext (key=1): M B N F
                           Ciphertext (key=-1): K Z L D
                           Ciphertext (key=26): L A M E




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26
                           Ciphertext (key=1): M B N F
                           Ciphertext (key=-1): K Z L D
                           Ciphertext (key=26): L A M E
                           Ciphertext (key=0): L A M E




‣ CAESAREAN CIPHER
Encryption history (2)


        “algorithm”:
   A = (A + key) mod 26,
   B = (B + key) mod 26
             ....
   Z = (Z + key) mod 26
             or:           Message: L A M E
    m = m + k mod 26
                           Ciphertext (key=1): M B N F
                           Ciphertext (key=-1): K Z L D
                           Ciphertext (key=26): L A M E
                           Ciphertext (key=0): L A M E
                           Ciphertext (key=13):Y N Z R (ROT13)



‣ CAESAREAN CIPHER
Encryption history (3)




‣ FLAWS ON THESE CIPHERS
Encryption history (3)




     ‣ Key is too easy to guess.




‣ FLAWS ON THESE CIPHERS
Encryption history (3)




     ‣ Key is too easy to guess.
     ‣ Key has to be send to Bob.




‣ FLAWS ON THESE CIPHERS
Encryption history (3)




     ‣ Key is too easy to guess.
     ‣ Key has to be send to Bob.
     ‣ Deterministic.




‣ FLAWS ON THESE CIPHERS
Encryption history (3)




     ‣ Key is too easy to guess.
     ‣ Key has to be send to Bob.
     ‣ Deterministic.
     ‣ Prone to frequency analysis.


‣ FLAWS ON THESE CIPHERS
Frequency Analysis (1)
Frequency Analysis (1)




   ‣ The usage of every letter in the English (or
     any other language) can be represented by
     a percentage.
Frequency Analysis (1)




   ‣ The usage of every letter in the English (or
     any other language) can be represented by
     a percentage.
   ‣ ‘E’ is used 12.7% of the times in english
     texts, the ‘Z’ only 0.074%.
Frequency Analysis (2)


                          Once upon a midnight dreary, while I pondered, weak and weary,
                          Over many a quaint and curious volume of forgotten lore—
                          While I nodded, nearly napping, suddenly there came a tapping,
                          As of some one gently rapping—rapping at my chamber door.
                          "'Tis some visitor," I muttered, "tapping at my chamber door—
                                                            Only this and nothing more."

                          Ah, distinctly I remember, it was in the bleak December,
                          And each separate dying ember wrought its ghost upon the floor.
                          Eagerly I wished the morrow;—vainly I had sought to borrow
                          From my books surcease of sorrow—sorrow for the lost Lenore—
                          For the rare and radiant maiden whom the angels name Lenore—
                                                            Nameless here for evermore.

                          And the silken sad uncertain rustling of each purple curtain
                          Thrilled me—filled me with fantastic terrors never felt before;
                          So that now, to still the beating of my heart, I stood repeating
                          "'Tis some visitor entreating entrance at my chamber door—
                          Some late visitor entreating entrance at my chamber door;—
                                                            This it is and nothing more."




       ‣ EDGAR ALLAN POE: THE RAVEN


http://www.gutenberg.org/cache/epub/14082/pg14082.txt
Frequency Analysis (3)




A small bit of text can result in differences, but still there
            are some letters we can deduce..

 ‣ “THE RAVEN”, FIRST PARAGRAPH
Frequency Analysis (3)




A small bit of text can result in differences, but still there
            are some letters we can deduce..

 ‣ “THE RAVEN”, FIRST PARAGRAPH
Frequency Analysis (4)




 We can deduce almost all letters just without even
    CARING about the crypto algorithm used.

‣ “THE RAVEN”, ALL PARAGRAPHS
Encryption algorithms




‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
Encryption algorithms




  ‣ Have an “open” algorithm.




‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
Encryption algorithms




  ‣ Have an “open” algorithm.
  ‣ Have strong mathematical proof.




‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
Encryption algorithms




  ‣ Have an “open” algorithm.
  ‣ Have strong mathematical proof.
  ‣ Knowing the algorithm cannot let you
    encrypt or decrypt without the key.



‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
Encryption algorithms (1)




‣ SYMMETRICAL ALGORITHMS
Encryption algorithms (1)




‣ Previous examples were symmetrical encryptions.




‣ SYMMETRICAL ALGORITHMS
Encryption algorithms (1)




‣ Previous examples were symmetrical encryptions.
‣ Same key is used for both encryption and decryption.




‣ SYMMETRICAL ALGORITHMS
Encryption algorithms (1)




‣ Previous examples were symmetrical encryptions.
‣ Same key is used for both encryption and decryption.
‣ Good symmetrical encryptions: AES, Blowfish, (3)DES




‣ SYMMETRICAL ALGORITHMS
Encryption algorithms (2)




‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
Encryption algorithms (2)




     ‣ How do we send over the key securely?




‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
Encryption algorithms (2)




     ‣ How do we send over the key securely?
     ‣ O hai egg, meet chicken.




‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
Public key encryption




                Another encryption method:
   asymmetrical encryption or public key encryption.




‣ FINALLY, WE HAVE ARRIVED...
Public key encryption (1)




        ‣ USES 2 KEYS INSTEAD OF ONE: A KEYPAIR


http://upload.wikimedia.org/wikipedia/commons/f/f9/Public_key_encryption.svg
Public key encryption (2)




   It is NOT possible to decrypt the message
       with same key that is used to encrypt


        We can encrypt with either key.
Public key encryption (3)




‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
Public key encryption (3)




   ‣ Can be used for encrypting data.




‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
Public key encryption (3)




   ‣ Can be used for encrypting data.
   ‣ Can be used for data validation and
      authentication (signing).




‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
Symmetrical vs Asymmetrical (1)


 Symmetrical                   Asymmetrical
 ✓   quick.                    ✓ no need to send over the
 ✓   not resource intensive.   (whole) key.
 ✓useful for small and large   ✓ can be used for encryption
 messages.                     and validation (signing).
 ✗ need to send over the key
                               ✗   very resource intensive.
 to the other side.
                               ✗ only   useful for small messages.
Symmetrical vs Asymmetrical (2)




  Use symmetrical encryption for the (large) message
    and encrypt the key used with an asymmetrical
                 encryption method.
Symmetrical vs Asymmetrical (3)


Hybrid
✓   quick
✓   not resource intensive
✓   useful for small and large messages
✓   safely exchange key data
Symmetrical vs Asymmetrical (3)


Hybrid
✓   quick
✓   not resource intensive
✓   useful for small and large messages
✓   safely exchange key data


                +
Symmetrical vs Asymmetrical (3)


          Hybrid
          ✓   quick
          ✓   not resource intensive
          ✓   useful for small and large messages
          ✓   safely exchange key data


                                       +                                        =



http://www.zastavki.com/pictures/1152x864/2008/Animals_Cats_Small_cat_005241_.jpg
How does it work?




     We will focus on the popular RSA,
   but there are other algorithms as well:
            DH, DSS(DSA) etc...
How does it work? (1)



    Public key encryption works on the
  premise that it is practically impossible
  to refactor a large number back into 2
         separate prime numbers.
How does it work? (1)



    Public key encryption works on the
  premise that it is practically impossible
  to refactor a large number back into 2
         separate prime numbers.

 Prime number is only divisible by 1 and
  itself: 2, 3, 5, 7, 11, 13, 17, 19 etc...
How does it work? (2)
How does it work? (2)



   ‣ There is no proof that it’s impossible to
     refactor quickly (all tough it doesn’t look
     plausible)
How does it work? (2)



   ‣ There is no proof that it’s impossible to
     refactor quickly (all tough it doesn’t look
     plausible)
   ‣ Brute-force decrypting is always lurking
     around (quicker machines, better algorithms).
How does it work? (2)



   ‣ There is no proof that it’s impossible to
     refactor quickly (all tough it doesn’t look
     plausible)
   ‣ Brute-force decrypting is always lurking
     around (quicker machines, better algorithms).
   ‣ Good enough today != good enough
     tomorrow.
How does it work? (3)
How does it work? (3)




            “large” number: 221
How does it work? (3)




            “large” number: 221


        but we cannot “calculate” its
     prime factors without brute force
                  (it’s 13 and 17 btw)
Math example




‣ LET’S DO SOME MATH
Math example



          This is mathness!
Math example




    No, this is RSAAAAAAAA
Math example
Math example



 ‣   p = (large) prime number
 ‣   q = (large) prime number (but not too close to p)
 ‣   n = p . q (= bit length of the rsa-key)
 ‣   φ = (p-1) . (q-1) (the φ thingie is called phi)
 ‣   e = gcd(e, φ) = 1
 ‣   d = e^-1 mod φ
 ‣   public key = tuple (n, e)
 ‣   private key = tuple (n, d)
Math example
Math example


Step 1: select primes P and Q




 ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 1: select primes P and Q

            ‣ P = 11




 ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 1: select primes P and Q

            ‣ P = 11
            ‣ Q=3




 ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 2: calculate N and Phi




 ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 2: calculate N and Phi

            ‣ N = P . Q = 11.3 = 33




 ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 2: calculate N and Phi

            ‣ N = P . Q = 11.3 = 33
            ‣ Phi = (11-1) . (3-1) = 10.2 = 20




 ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
Math example


Step 3: find e




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
Math example


Step 3: find e

           ‣ e = 3 (Fermat prime: 3, 17, 65537)




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
Math example


Step 3: find e

           ‣ e = 3 (Fermat prime: 3, 17, 65537)
           ‣ gcd(3, 20) = 1




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
Math example


Step 4: find d




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
Math example


Step 4: find d
           ‣ Extended Euclidean Algorithm gives 7




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
Math example


Step 4: find d
           ‣ Extended Euclidean Algorithm gives 7
           ‣ brute force: (e.d mod n = 1)




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
Math example


Step 4: find d
           ‣ Extended Euclidean Algorithm gives 7
           ‣ brute force: (e.d mod n = 1)
                 3 . 1 = 3 mod 20 = 3            3 . 6 = 18 mod 20 = 18
                 3 . 2 = 6 mod 20 = 6            3 . 7 = 21 mod 20 = 1
                 3 . 3 = 9 mod 20 = 9            3 . 8 = 24 mod 20 = 4
                 3 . 4 = 12 mod 20 = 12          3 . 9 = 27 mod 20 = 7
                 3 . 5 = 15 mod 20 = 15




 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
Math example




‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
Math example




          That’s it:




‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
Math example




          That’s it:
            ‣ public key = (n, e) = (33, 3)




‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
Math example




          That’s it:
            ‣ public key = (n, e) = (33, 3)
            ‣ private key = (n, d) = (33, 7)




‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
Math example




 The actual math is much more complex since
  we use very large numbers, but it all comes
 down to these (relatively simple) calculations..
Encrypting & decrypting




              Encrypting a message:
                 c = me mod n

              Decrypting a message:
                 m = cd mod n
Encrypting & decrypting (1)


    Encrypting a message: private key = (n,d) = (33, 7):

     m = 13, 20, 15, 5

     13^7 mod 33 = 7
     20^7 mod 33 = 26
     15^7 mod 33 = 27
     5^7 mod 33 = 14

     c = 7, 26, 27,14
Encrypting & decrypting (2)


     Decrypting a message: public key = (n,e) = (33, 3):

     c = 7, 26, 27, 14

     7^3 mod 33 = 13
     26^3 mod 33 = 20
     27^3 mod 33 = 15
     14^3 mod 33 =5

     m = 13, 20, 15, 5
Encrypting & decrypting (3)
Encrypting & decrypting (3)




   ‣ A message is an “integer”, not a block of data.
Encrypting & decrypting (3)




   ‣ A message is an “integer”, not a block of data.
   ‣ A message must be between 2 and n-1.
Encrypting & decrypting (3)




   ‣ A message is an “integer”, not a block of data.
   ‣ A message must be between 2 and n-1.
   ‣ Deterministic, so we must use a padding
     scheme to make it non-deterministic.
Encrypting & decrypting (4)




      ‣ Public Key Cryptography Standard #1
      ‣ Pads data with (random) bytes up to n bits
        in length (v1.5 or OAEP/v2.x).
      ‣ Got it flaws and weaknesses too. Always
        use the latest available version (v2.1)



‣ http://www.rsa.com/rsalabs/node.asp?id=2125
Encrypting & decrypting (5)



                Data = 4E636AF98E40F3ADCFCCB698F4E80B9F

                The encoded message block, EMB, after encoding but before encryption, with random
                padding bytes shown in green:
                0002257F48FD1F1793B7E5E02306F2D3228F5C95ADF5F31566729F132AA12009
                E3FC9B2B475CD6944EF191E3F59545E671E474B555799FE3756099F044964038
                B16B2148E9A2F9C6F44BB5C52E3C6C8061CF694145FAFDB24402AD1819EACEDF
                4A36C6E4D2CD8FC1D62E5A1268F496004E636AF98E40F3ADCFCCB698F4E80B9F

                After RSA encryption, the output is:
                3D2AB25B1EB667A40F504CC4D778EC399A899C8790EDECEF062CD739492C9CE5
                8B92B9ECF32AF4AAC7A61EAEC346449891F49A722378E008EFF0B0A8DBC6E621
                EDC90CEC64CF34C640F5B36C48EE9322808AF8F4A0212B28715C76F3CB99AC7E
                609787ADCE055839829E0142C44B676D218111FFE69F9D41424E177CBA3A435B




      ‣ PKCS#1 (v1.5) IN ACTION


http://www.di-mgt.com.au/rsa_alg.html#pkcs1schemes
Implementations of public keys in real life




http://farm4.static.flickr.com/3538/3420164047_09ccc14e29.jpg
Web communication




                                 public key encryption in


     Web communications
             (aka: I never use my credit card for internet purchases. It’s not safe.
 Instead, I gave it to the waiter who walked away with it into the kitchen for 5 minutes..)
Web communication (1)




    Welcome to 1991: HTTP is plaintext.
    Everybody can be trusted. This page is under
    construction, here’s a photo of my cat and a
    link to geocities.




‣ BACK IN TIME
Web communication (2)




‣ BUT NOW...
Web communication (2)




    ‣ Free WiFi everywhere




‣ BUT NOW...
Web communication (2)




    ‣ Free WiFi everywhere
    ‣ Traffic snooping




‣ BUT NOW...
Web communication (2)




    ‣ Free WiFi everywhere
    ‣ Traffic snooping
    ‣ Authorization: Basic? (yes,VERY basic)


‣ BUT NOW...
Web communication (3)




‣ USING HTTPS
Web communication (3)




‣ HTTP encapsulated by TLS (previously SSL).




‣ USING HTTPS
Web communication (3)




‣ HTTP encapsulated by TLS (previously SSL).
‣ More or less: an encryption layer on top of http.




‣ USING HTTPS
Web communication (3)




‣ HTTP encapsulated by TLS (previously SSL).
‣ More or less: an encryption layer on top of http.
‣ Hybrid encryption.



‣ USING HTTPS
Web communication (4)
Web communication (4)



 ‣ Actual encryption methodology is decided
   by the browser and the server (highest
   possible encryption used).
Web communication (4)



 ‣ Actual encryption methodology is decided
   by the browser and the server (highest
   possible encryption used).
 ‣ Symmetric encryption (AES-256, others)
Web communication (4)



 ‣ Actual encryption methodology is decided
   by the browser and the server (highest
   possible encryption used).
 ‣ Symmetric encryption (AES-256, others)
 ‣ But both sides needs the same key, so we
   have the same problem as before: how do we
   send over the key?
Web communication (5)
Web communication (5)




‣ Key is exchanged in a public/private encrypted
  communication.
Web communication (5)




‣ Key is exchanged in a public/private encrypted
  communication.
‣ Which public and private key?
Web communication (5)




‣ Key is exchanged in a public/private encrypted
  communication.
‣ Which public and private key?
‣ They are stored inside the server’s SSL certificate
Web communication (6)




‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (6)




  ‣ Browser sends over its encryption methods.




‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (6)




  ‣ Browser sends over its encryption methods.
  ‣ Server decides which one to use.




‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (6)




  ‣ Browser sends over its encryption methods.
  ‣ Server decides which one to use.
  ‣ Server send certificate(s).




‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (6)




  ‣   Browser sends over its encryption methods.
  ‣   Server decides which one to use.
  ‣   Server send certificate(s).
  ‣   Client sends “session key” encrypted by the
      public key found in the server certificate.




‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (6)




  ‣   Browser sends over its encryption methods.
  ‣   Server decides which one to use.
  ‣   Server send certificate(s).
  ‣   Client sends “session key” encrypted by the
      public key found in the server certificate.
  ‣   Server and client uses the “session key” for
      symmetrical encryption.


‣ “GLOBAL” HTTPS HANDSHAKE
Web communication (7)
Web communication (7)




‣ Thus: Public/private encryption is only used in
  establishing a secondary (better!?) encryption.
Web communication (7)




‣ Thus: Public/private encryption is only used in
    establishing a secondary (better!?) encryption.
‣   SSL/TLS is a separate talk (it’s way more complex
    as this)
Email communication


                                       public key encryption in


             Email communication
(aka: the worst communication method invented when it comes to privacy or secrecy, except for yelling)
Email communication (2)




http://change-your-ip.com/wp-content/uploads/image/nigerian_419_scam.jpg
http://torontoemerg.files.wordpress.com/2010/09/spam.gif
Email communication (3)




‣ DID YOU EVER SEND/RECEIVE EMAILS LIKE THIS?
Email communication (4)
Email communication (4)



  ‣ Did Bill really send this email?
Email communication (4)



  ‣ Did Bill really send this email?
  ‣ Do we know for sure that nobody has read
    this email (before it came to us?)
Email communication (4)



  ‣ Did Bill really send this email?
  ‣ Do we know for sure that nobody has read
    this email (before it came to us?)
  ‣ Do we know for sure that the contents of
    the message isn’t tampered with?
Email communication (4)



  ‣ Did Bill really send this email?
  ‣ Do we know for sure that nobody has read
    this email (before it came to us?)
  ‣ Do we know for sure that the contents of
    the message isn’t tampered with?
  ‣ We use signing!
Signing (1)
Signing (1)



   ‣ Signing a message means adding a signature
     that authenticates the validity of a message.
Signing (1)



   ‣ Signing a message means adding a signature
     that authenticates the validity of a message.
   ‣ Like md5 or sha1, so when the message
     changes, so will the signature.
Signing (1)



   ‣ Signing a message means adding a signature
     that authenticates the validity of a message.
   ‣ Like md5 or sha1, so when the message
     changes, so will the signature.
   ‣ This works on the premise that Alice and
     only Alice has the private key that can
     create the signature.
Signing (2)




http://en.wikipedia.org/wiki/File:Digital_Signature_diagram.svg
Signing (3)
Signing (3)



   ‣ GPG / PGP: Application for signing and/or
     encrypting data (or emails).
Signing (3)



   ‣ GPG / PGP: Application for signing and/or
     encrypting data (or emails).
   ‣ Try it yourself with Thunderbird’s Enigmail
     extension.
Signing (3)



   ‣ GPG / PGP: Application for signing and/or
     encrypting data (or emails).
   ‣ Try it yourself with Thunderbird’s Enigmail
     extension.
   ‣ Public keys can be send / found on PGP-
     servers so you don’t need to send your
     keys to everybody all the time.
Signing (4)
Signing (5)
Signing (5)
Signing (5)
Email communication (10)




‣ ADVANTAGES OF SIGNING YOUR MAIL
Email communication (10)




    ‣ Everybody can send emails that ONLY YOU
      can read.




‣ ADVANTAGES OF SIGNING YOUR MAIL
Email communication (10)




    ‣ Everybody can send emails that ONLY YOU
      can read.
    ‣ Everybody can verify that YOU have send
      the email and that it is authentic.




‣ ADVANTAGES OF SIGNING YOUR MAIL
Email communication (10)




    ‣ Everybody can send emails that ONLY YOU
      can read.
    ‣ Everybody can verify that YOU have send
      the email and that it is authentic.
    ‣ Why is this not the standard?




‣ ADVANTAGES OF SIGNING YOUR MAIL
Email communication (10)




    ‣ Everybody can send emails that ONLY YOU
      can read.
    ‣ Everybody can verify that YOU have send
      the email and that it is authentic.
    ‣ Why is this not the standard?
    ‣ No really, why isn’t it the standard?



‣ ADVANTAGES OF SIGNING YOUR MAIL
Email communication (7)
Email communication (8)
Email communication (9)




                      Stupidity trumps
                         everything:
                      Don’t loose your
                       private key(s)
                     (as I did on multiple occasions)




http://farm4.static.flickr.com/3231/2783827537_b4d2a5cc9a.jpg
Other applications



                          PGP / GPG
                    (encrypt / decrypt sensitive data)


                            OpenSSH
                  (Secure connection to other systems)


                               IPSEC
                             (VPN tunnels)


                      Software signing


‣ PUBLIC KEY ENCRYPTION IN OTHER FIELDS
Any questions?




http://farm1.static.flickr.com/73/163450213_18478d3aa6_d.jpg
Please rate my talk on joind.in: http://joind.in/3305

‣ THANK YOU FOR YOUR ATTENTION

More Related Content

What's hot

Application Security | Application Security Tutorial | Cyber Security Certifi...
Application Security | Application Security Tutorial | Cyber Security Certifi...Application Security | Application Security Tutorial | Cyber Security Certifi...
Application Security | Application Security Tutorial | Cyber Security Certifi...Edureka!
 
Security Mechanisms
Security MechanismsSecurity Mechanisms
Security Mechanismspriya_trehan
 
What is Cryptography and Types of attacks in it
What is Cryptography and Types of attacks in itWhat is Cryptography and Types of attacks in it
What is Cryptography and Types of attacks in itlavakumar Thatisetti
 
Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Umesh Mahawar
 
Cybersecurity Risk Management Program and Your Organization
Cybersecurity Risk Management Program and Your OrganizationCybersecurity Risk Management Program and Your Organization
Cybersecurity Risk Management Program and Your OrganizationMcKonly & Asbury, LLP
 
Cyber security analysis presentation
Cyber security analysis presentationCyber security analysis presentation
Cyber security analysis presentationVaibhav R
 
Information security: importance of having defined policy & process
Information security: importance of having defined policy & processInformation security: importance of having defined policy & process
Information security: importance of having defined policy & processInformation Technology Society Nepal
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
User authentication
User authenticationUser authentication
User authenticationCAS
 
An overview of access control
An overview of access controlAn overview of access control
An overview of access controlElimity
 
Cryptography and Information Security
Cryptography and Information SecurityCryptography and Information Security
Cryptography and Information SecurityDr Naim R Kidwai
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
Advanced Persistent Threat
Advanced Persistent ThreatAdvanced Persistent Threat
Advanced Persistent ThreatAmmar WK
 
Fundamentals of Network security
Fundamentals of Network securityFundamentals of Network security
Fundamentals of Network securityAPNIC
 

What's hot (20)

Application Security | Application Security Tutorial | Cyber Security Certifi...
Application Security | Application Security Tutorial | Cyber Security Certifi...Application Security | Application Security Tutorial | Cyber Security Certifi...
Application Security | Application Security Tutorial | Cyber Security Certifi...
 
Security Mechanisms
Security MechanismsSecurity Mechanisms
Security Mechanisms
 
What is Cryptography and Types of attacks in it
What is Cryptography and Types of attacks in itWhat is Cryptography and Types of attacks in it
What is Cryptography and Types of attacks in it
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)
 
Secure Your Encryption with HSM
Secure Your Encryption with HSMSecure Your Encryption with HSM
Secure Your Encryption with HSM
 
Cryptography
CryptographyCryptography
Cryptography
 
Cybersecurity Risk Management Program and Your Organization
Cybersecurity Risk Management Program and Your OrganizationCybersecurity Risk Management Program and Your Organization
Cybersecurity Risk Management Program and Your Organization
 
Cyber security analysis presentation
Cyber security analysis presentationCyber security analysis presentation
Cyber security analysis presentation
 
Secure Coding and Threat Modeling
Secure Coding and Threat ModelingSecure Coding and Threat Modeling
Secure Coding and Threat Modeling
 
Information security: importance of having defined policy & process
Information security: importance of having defined policy & processInformation security: importance of having defined policy & process
Information security: importance of having defined policy & process
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
User authentication
User authenticationUser authentication
User authentication
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
An overview of access control
An overview of access controlAn overview of access control
An overview of access control
 
Cryptography and Information Security
Cryptography and Information SecurityCryptography and Information Security
Cryptography and Information Security
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Advanced Persistent Threat
Advanced Persistent ThreatAdvanced Persistent Threat
Advanced Persistent Threat
 
Understanding cyber resilience
Understanding cyber resilienceUnderstanding cyber resilience
Understanding cyber resilience
 
Fundamentals of Network security
Fundamentals of Network securityFundamentals of Network security
Fundamentals of Network security
 

Viewers also liked

IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrack
IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrackIoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrack
IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrackThierry Lestable
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3koolkampus
 
Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...Mazin Alwaaly
 
Ch03 block-cipher-and-data-encryption-standard
Ch03 block-cipher-and-data-encryption-standardCh03 block-cipher-and-data-encryption-standard
Ch03 block-cipher-and-data-encryption-standardtarekiceiuk
 
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)Entrust Datacard
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101Joshua Thijssen
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsSam Bowne
 
Block Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationBlock Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationVittorio Giovara
 
Cryptography
CryptographyCryptography
CryptographyAnandKaGe
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptographysubhradeep mitra
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
Information and data security block cipher operation
Information and data security block cipher operationInformation and data security block cipher operation
Information and data security block cipher operationMazin Alwaaly
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniquesMohd Arif
 

Viewers also liked (20)

IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrack
IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrackIoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrack
IoT-LPWAN LoRa Geoloc - sagemcom - m2m-innovationworld_geotrack
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
 
Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...Information and data security block cipher and the data encryption standard (...
Information and data security block cipher and the data encryption standard (...
 
Ch03 block-cipher-and-data-encryption-standard
Ch03 block-cipher-and-data-encryption-standardCh03 block-cipher-and-data-encryption-standard
Ch03 block-cipher-and-data-encryption-standard
 
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)
Zero to ECC in 30 Minutes: A primer on Elliptic Curve Cryptography (ECC)
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve Cryptosystems
 
Block Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For AuthenticationBlock Cipher Modes of Operation And Cmac For Authentication
Block Cipher Modes of Operation And Cmac For Authentication
 
Ecc2
Ecc2Ecc2
Ecc2
 
Substitution cipher
Substitution cipher Substitution cipher
Substitution cipher
 
Cryptography
CryptographyCryptography
Cryptography
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Substitution Cipher
Substitution CipherSubstitution Cipher
Substitution Cipher
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptography
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
Information and data security block cipher operation
Information and data security block cipher operationInformation and data security block cipher operation
Information and data security block cipher operation
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Cipher techniques
Cipher techniquesCipher techniques
Cipher techniques
 

Similar to Alice & bob public key cryptography 101

Alice & bob public key cryptography 101 - uncon dpc
Alice & bob  public key cryptography 101 - uncon dpcAlice & bob  public key cryptography 101 - uncon dpc
Alice & bob public key cryptography 101 - uncon dpcJoshua Thijssen
 
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppt
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.pptdokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppt
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppthusnainali397602
 
Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...DefCamp
 
Cryptography - Discrete Mathematics
Cryptography - Discrete MathematicsCryptography - Discrete Mathematics
Cryptography - Discrete MathematicsACM-KU
 
Introductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information SecurityIntroductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information SecurityBikramjit Sarkar, Ph.D.
 
Computer security
Computer securityComputer security
Computer securityFraboni Ec
 
Computer security
Computer security Computer security
Computer security Harry Potter
 
Computer security
Computer security Computer security
Computer security Tony Nguyen
 
Computer security
Computer securityComputer security
Computer securityDavid Hoen
 
Computer security
Computer securityComputer security
Computer securityJames Wong
 
Cs166 mynote
Cs166 mynoteCs166 mynote
Cs166 mynoteKaya Ota
 
Basic Encryption Decryption Chapter 2
Basic Encryption Decryption Chapter 2Basic Encryption Decryption Chapter 2
Basic Encryption Decryption Chapter 2AfiqEfendy Zaen
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesJanani S
 
Data Protection Techniques and Cryptography
Data Protection Techniques and CryptographyData Protection Techniques and Cryptography
Data Protection Techniques and CryptographyTalha SAVAS
 
Computer Security Lecture 2: Classical Encryption Techniques 1
Computer Security Lecture 2: Classical Encryption Techniques 1Computer Security Lecture 2: Classical Encryption Techniques 1
Computer Security Lecture 2: Classical Encryption Techniques 1Mohamed Loey
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographyDavid Evans
 

Similar to Alice & bob public key cryptography 101 (20)

Alice & bob public key cryptography 101 - uncon dpc
Alice & bob  public key cryptography 101 - uncon dpcAlice & bob  public key cryptography 101 - uncon dpc
Alice & bob public key cryptography 101 - uncon dpc
 
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppt
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.pptdokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppt
dokumen.tips_chapter-2-classical-encryption-techniques-56969e027fe68.ppt
 
Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...
 
Cryptography - Discrete Mathematics
Cryptography - Discrete MathematicsCryptography - Discrete Mathematics
Cryptography - Discrete Mathematics
 
Introductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information SecurityIntroductory Lecture on Cryptography and Information Security
Introductory Lecture on Cryptography and Information Security
 
Cryptography
CryptographyCryptography
Cryptography
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer security Computer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer security Computer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Computer security
Computer securityComputer security
Computer security
 
Cs166 mynote
Cs166 mynoteCs166 mynote
Cs166 mynote
 
Basic Encryption Decryption Chapter 2
Basic Encryption Decryption Chapter 2Basic Encryption Decryption Chapter 2
Basic Encryption Decryption Chapter 2
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Data Protection Techniques and Cryptography
Data Protection Techniques and CryptographyData Protection Techniques and Cryptography
Data Protection Techniques and Cryptography
 
Computer Security Lecture 2: Classical Encryption Techniques 1
Computer Security Lecture 2: Classical Encryption Techniques 1Computer Security Lecture 2: Classical Encryption Techniques 1
Computer Security Lecture 2: Classical Encryption Techniques 1
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 

More from Joshua Thijssen

Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionJoshua Thijssen
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfzJoshua Thijssen
 
Representation state transfer and some other important stuff
Representation state transfer and some other important stuffRepresentation state transfer and some other important stuff
Representation state transfer and some other important stuffJoshua Thijssen
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTJoshua Thijssen
 
15 protips for mysql users
15 protips for mysql users15 protips for mysql users
15 protips for mysql usersJoshua Thijssen
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duoJoshua Thijssen
 
PFZ WorkshopDay Linux - Advanced
PFZ WorkshopDay Linux - AdvancedPFZ WorkshopDay Linux - Advanced
PFZ WorkshopDay Linux - AdvancedJoshua Thijssen
 
PFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicPFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicJoshua Thijssen
 

More from Joshua Thijssen (12)

Moved 301
Moved 301Moved 301
Moved 301
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Cipher block modes
Cipher block modesCipher block modes
Cipher block modes
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG edition
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfz
 
Representation state transfer and some other important stuff
Representation state transfer and some other important stuffRepresentation state transfer and some other important stuff
Representation state transfer and some other important stuff
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APT
 
15 protips for mysql users
15 protips for mysql users15 protips for mysql users
15 protips for mysql users
 
Workshop unittesting
Workshop unittestingWorkshop unittesting
Workshop unittesting
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
 
PFZ WorkshopDay Linux - Advanced
PFZ WorkshopDay Linux - AdvancedPFZ WorkshopDay Linux - Advanced
PFZ WorkshopDay Linux - Advanced
 
PFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicPFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - Basic
 

Recently uploaded

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Alice & bob public key cryptography 101

  • 1. Alice & Bob Public key cryptography 101 Loadays - 16 & 17 april 2011 Antwerp - Belgium http://joind.in/3305
  • 2. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise Development in PHP, Python, Perl, C, Java.... Blogs: http://www.adayinthelifeof.nl http://www.enrise.com/blog Email: joshua@enrise.com Twitter: @jaytaph Identi.ca: jaytaph
  • 3. What are we discussing? ‣ An introduction into public key encryption ‣ But first of all... ‣ Who are Alice and Bob???
  • 5. Terminology (1) Meet Alice, and Bob.
  • 6. Terminology (2) Fictional characters who are representing either side of the (communication) line. Person A(lice) is sending a message to person B(ob).
  • 8. Encryption history Before we look at good encryptions, let’s take a look at some bad ones... http://www.flickr.com/photos/wwworks/4612188594/sizes/m/in/photostream/
  • 9. Encryption history (1) “algorithm”: A = 1, B = 2, C = 3, ...., Z = 26 ‣ SUBSTITUTION SCHEME
  • 10. Encryption history (1) “algorithm”: A = 1, B = 2, C = 3, ...., Z = 26 Encrypted message: 12,1,13,5 ‣ SUBSTITUTION SCHEME
  • 11. Encryption history (1) “algorithm”: A = 1, B = 2, C = 3, ...., Z = 26 Encrypted message: 12,1,13,5 = L,A,M,E ‣ SUBSTITUTION SCHEME
  • 12. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: m = m + k mod 26 ‣ CAESAREAN CIPHER
  • 13. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 ‣ CAESAREAN CIPHER
  • 14. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 Ciphertext (key=1): M B N F ‣ CAESAREAN CIPHER
  • 15. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 Ciphertext (key=1): M B N F Ciphertext (key=-1): K Z L D ‣ CAESAREAN CIPHER
  • 16. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 Ciphertext (key=1): M B N F Ciphertext (key=-1): K Z L D Ciphertext (key=26): L A M E ‣ CAESAREAN CIPHER
  • 17. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 Ciphertext (key=1): M B N F Ciphertext (key=-1): K Z L D Ciphertext (key=26): L A M E Ciphertext (key=0): L A M E ‣ CAESAREAN CIPHER
  • 18. Encryption history (2) “algorithm”: A = (A + key) mod 26, B = (B + key) mod 26 .... Z = (Z + key) mod 26 or: Message: L A M E m = m + k mod 26 Ciphertext (key=1): M B N F Ciphertext (key=-1): K Z L D Ciphertext (key=26): L A M E Ciphertext (key=0): L A M E Ciphertext (key=13):Y N Z R (ROT13) ‣ CAESAREAN CIPHER
  • 19. Encryption history (3) ‣ FLAWS ON THESE CIPHERS
  • 20. Encryption history (3) ‣ Key is too easy to guess. ‣ FLAWS ON THESE CIPHERS
  • 21. Encryption history (3) ‣ Key is too easy to guess. ‣ Key has to be send to Bob. ‣ FLAWS ON THESE CIPHERS
  • 22. Encryption history (3) ‣ Key is too easy to guess. ‣ Key has to be send to Bob. ‣ Deterministic. ‣ FLAWS ON THESE CIPHERS
  • 23. Encryption history (3) ‣ Key is too easy to guess. ‣ Key has to be send to Bob. ‣ Deterministic. ‣ Prone to frequency analysis. ‣ FLAWS ON THESE CIPHERS
  • 25. Frequency Analysis (1) ‣ The usage of every letter in the English (or any other language) can be represented by a percentage.
  • 26. Frequency Analysis (1) ‣ The usage of every letter in the English (or any other language) can be represented by a percentage. ‣ ‘E’ is used 12.7% of the times in english texts, the ‘Z’ only 0.074%.
  • 27. Frequency Analysis (2) Once upon a midnight dreary, while I pondered, weak and weary, Over many a quaint and curious volume of forgotten lore— While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping—rapping at my chamber door. "'Tis some visitor," I muttered, "tapping at my chamber door— Only this and nothing more." Ah, distinctly I remember, it was in the bleak December, And each separate dying ember wrought its ghost upon the floor. Eagerly I wished the morrow;—vainly I had sought to borrow From my books surcease of sorrow—sorrow for the lost Lenore— For the rare and radiant maiden whom the angels name Lenore— Nameless here for evermore. And the silken sad uncertain rustling of each purple curtain Thrilled me—filled me with fantastic terrors never felt before; So that now, to still the beating of my heart, I stood repeating "'Tis some visitor entreating entrance at my chamber door— Some late visitor entreating entrance at my chamber door;— This it is and nothing more." ‣ EDGAR ALLAN POE: THE RAVEN http://www.gutenberg.org/cache/epub/14082/pg14082.txt
  • 28. Frequency Analysis (3) A small bit of text can result in differences, but still there are some letters we can deduce.. ‣ “THE RAVEN”, FIRST PARAGRAPH
  • 29. Frequency Analysis (3) A small bit of text can result in differences, but still there are some letters we can deduce.. ‣ “THE RAVEN”, FIRST PARAGRAPH
  • 30. Frequency Analysis (4) We can deduce almost all letters just without even CARING about the crypto algorithm used. ‣ “THE RAVEN”, ALL PARAGRAPHS
  • 31. Encryption algorithms ‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
  • 32. Encryption algorithms ‣ Have an “open” algorithm. ‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
  • 33. Encryption algorithms ‣ Have an “open” algorithm. ‣ Have strong mathematical proof. ‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
  • 34. Encryption algorithms ‣ Have an “open” algorithm. ‣ Have strong mathematical proof. ‣ Knowing the algorithm cannot let you encrypt or decrypt without the key. ‣ WHAT IS A GOOD ENCRYPTION ALGORITHM?
  • 35. Encryption algorithms (1) ‣ SYMMETRICAL ALGORITHMS
  • 36. Encryption algorithms (1) ‣ Previous examples were symmetrical encryptions. ‣ SYMMETRICAL ALGORITHMS
  • 37. Encryption algorithms (1) ‣ Previous examples were symmetrical encryptions. ‣ Same key is used for both encryption and decryption. ‣ SYMMETRICAL ALGORITHMS
  • 38. Encryption algorithms (1) ‣ Previous examples were symmetrical encryptions. ‣ Same key is used for both encryption and decryption. ‣ Good symmetrical encryptions: AES, Blowfish, (3)DES ‣ SYMMETRICAL ALGORITHMS
  • 39. Encryption algorithms (2) ‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
  • 40. Encryption algorithms (2) ‣ How do we send over the key securely? ‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
  • 41. Encryption algorithms (2) ‣ How do we send over the key securely? ‣ O hai egg, meet chicken. ‣ THE PROBLEM WITH SYMMETRICAL ALGORITHMS
  • 42. Public key encryption Another encryption method: asymmetrical encryption or public key encryption. ‣ FINALLY, WE HAVE ARRIVED...
  • 43. Public key encryption (1) ‣ USES 2 KEYS INSTEAD OF ONE: A KEYPAIR http://upload.wikimedia.org/wikipedia/commons/f/f9/Public_key_encryption.svg
  • 44. Public key encryption (2) It is NOT possible to decrypt the message with same key that is used to encrypt We can encrypt with either key.
  • 45. Public key encryption (3) ‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
  • 46. Public key encryption (3) ‣ Can be used for encrypting data. ‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
  • 47. Public key encryption (3) ‣ Can be used for encrypting data. ‣ Can be used for data validation and authentication (signing). ‣ MULTIPLE APPLICATIONS FOR PUBLIC KEY ENCRYPTION
  • 48. Symmetrical vs Asymmetrical (1) Symmetrical Asymmetrical ✓ quick. ✓ no need to send over the ✓ not resource intensive. (whole) key. ✓useful for small and large ✓ can be used for encryption messages. and validation (signing). ✗ need to send over the key ✗ very resource intensive. to the other side. ✗ only useful for small messages.
  • 49. Symmetrical vs Asymmetrical (2) Use symmetrical encryption for the (large) message and encrypt the key used with an asymmetrical encryption method.
  • 50. Symmetrical vs Asymmetrical (3) Hybrid ✓ quick ✓ not resource intensive ✓ useful for small and large messages ✓ safely exchange key data
  • 51. Symmetrical vs Asymmetrical (3) Hybrid ✓ quick ✓ not resource intensive ✓ useful for small and large messages ✓ safely exchange key data +
  • 52. Symmetrical vs Asymmetrical (3) Hybrid ✓ quick ✓ not resource intensive ✓ useful for small and large messages ✓ safely exchange key data + = http://www.zastavki.com/pictures/1152x864/2008/Animals_Cats_Small_cat_005241_.jpg
  • 53. How does it work? We will focus on the popular RSA, but there are other algorithms as well: DH, DSS(DSA) etc...
  • 54. How does it work? (1) Public key encryption works on the premise that it is practically impossible to refactor a large number back into 2 separate prime numbers.
  • 55. How does it work? (1) Public key encryption works on the premise that it is practically impossible to refactor a large number back into 2 separate prime numbers. Prime number is only divisible by 1 and itself: 2, 3, 5, 7, 11, 13, 17, 19 etc...
  • 56. How does it work? (2)
  • 57. How does it work? (2) ‣ There is no proof that it’s impossible to refactor quickly (all tough it doesn’t look plausible)
  • 58. How does it work? (2) ‣ There is no proof that it’s impossible to refactor quickly (all tough it doesn’t look plausible) ‣ Brute-force decrypting is always lurking around (quicker machines, better algorithms).
  • 59. How does it work? (2) ‣ There is no proof that it’s impossible to refactor quickly (all tough it doesn’t look plausible) ‣ Brute-force decrypting is always lurking around (quicker machines, better algorithms). ‣ Good enough today != good enough tomorrow.
  • 60. How does it work? (3)
  • 61. How does it work? (3) “large” number: 221
  • 62. How does it work? (3) “large” number: 221 but we cannot “calculate” its prime factors without brute force (it’s 13 and 17 btw)
  • 63. Math example ‣ LET’S DO SOME MATH
  • 64. Math example This is mathness!
  • 65. Math example No, this is RSAAAAAAAA
  • 67. Math example ‣ p = (large) prime number ‣ q = (large) prime number (but not too close to p) ‣ n = p . q (= bit length of the rsa-key) ‣ φ = (p-1) . (q-1) (the φ thingie is called phi) ‣ e = gcd(e, φ) = 1 ‣ d = e^-1 mod φ ‣ public key = tuple (n, e) ‣ private key = tuple (n, d)
  • 69. Math example Step 1: select primes P and Q ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
  • 70. Math example Step 1: select primes P and Q ‣ P = 11 ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
  • 71. Math example Step 1: select primes P and Q ‣ P = 11 ‣ Q=3 ‣ P = ? | Q = ? | N = ? | Phi = ? | e = ? | d = ?
  • 72. Math example Step 2: calculate N and Phi ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
  • 73. Math example Step 2: calculate N and Phi ‣ N = P . Q = 11.3 = 33 ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
  • 74. Math example Step 2: calculate N and Phi ‣ N = P . Q = 11.3 = 33 ‣ Phi = (11-1) . (3-1) = 10.2 = 20 ‣ P = 11 | Q = 3 | N = ? | Phi = ? | e = ? | d = ?
  • 75. Math example Step 3: find e ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
  • 76. Math example Step 3: find e ‣ e = 3 (Fermat prime: 3, 17, 65537) ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
  • 77. Math example Step 3: find e ‣ e = 3 (Fermat prime: 3, 17, 65537) ‣ gcd(3, 20) = 1 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = ? | d = ?
  • 78. Math example Step 4: find d ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
  • 79. Math example Step 4: find d ‣ Extended Euclidean Algorithm gives 7 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
  • 80. Math example Step 4: find d ‣ Extended Euclidean Algorithm gives 7 ‣ brute force: (e.d mod n = 1) ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
  • 81. Math example Step 4: find d ‣ Extended Euclidean Algorithm gives 7 ‣ brute force: (e.d mod n = 1) 3 . 1 = 3 mod 20 = 3 3 . 6 = 18 mod 20 = 18 3 . 2 = 6 mod 20 = 6 3 . 7 = 21 mod 20 = 1 3 . 3 = 9 mod 20 = 9 3 . 8 = 24 mod 20 = 4 3 . 4 = 12 mod 20 = 12 3 . 9 = 27 mod 20 = 7 3 . 5 = 15 mod 20 = 15 ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = ?
  • 82. Math example ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
  • 83. Math example That’s it: ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
  • 84. Math example That’s it: ‣ public key = (n, e) = (33, 3) ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
  • 85. Math example That’s it: ‣ public key = (n, e) = (33, 3) ‣ private key = (n, d) = (33, 7) ‣ P = 11 | Q = 3 | N = 33 | Phi = 20 | e = 3 | d = 7
  • 86. Math example The actual math is much more complex since we use very large numbers, but it all comes down to these (relatively simple) calculations..
  • 87. Encrypting & decrypting Encrypting a message: c = me mod n Decrypting a message: m = cd mod n
  • 88. Encrypting & decrypting (1) Encrypting a message: private key = (n,d) = (33, 7): m = 13, 20, 15, 5 13^7 mod 33 = 7 20^7 mod 33 = 26 15^7 mod 33 = 27 5^7 mod 33 = 14 c = 7, 26, 27,14
  • 89. Encrypting & decrypting (2) Decrypting a message: public key = (n,e) = (33, 3): c = 7, 26, 27, 14 7^3 mod 33 = 13 26^3 mod 33 = 20 27^3 mod 33 = 15 14^3 mod 33 =5 m = 13, 20, 15, 5
  • 91. Encrypting & decrypting (3) ‣ A message is an “integer”, not a block of data.
  • 92. Encrypting & decrypting (3) ‣ A message is an “integer”, not a block of data. ‣ A message must be between 2 and n-1.
  • 93. Encrypting & decrypting (3) ‣ A message is an “integer”, not a block of data. ‣ A message must be between 2 and n-1. ‣ Deterministic, so we must use a padding scheme to make it non-deterministic.
  • 94. Encrypting & decrypting (4) ‣ Public Key Cryptography Standard #1 ‣ Pads data with (random) bytes up to n bits in length (v1.5 or OAEP/v2.x). ‣ Got it flaws and weaknesses too. Always use the latest available version (v2.1) ‣ http://www.rsa.com/rsalabs/node.asp?id=2125
  • 95. Encrypting & decrypting (5) Data = 4E636AF98E40F3ADCFCCB698F4E80B9F The encoded message block, EMB, after encoding but before encryption, with random padding bytes shown in green: 0002257F48FD1F1793B7E5E02306F2D3228F5C95ADF5F31566729F132AA12009 E3FC9B2B475CD6944EF191E3F59545E671E474B555799FE3756099F044964038 B16B2148E9A2F9C6F44BB5C52E3C6C8061CF694145FAFDB24402AD1819EACEDF 4A36C6E4D2CD8FC1D62E5A1268F496004E636AF98E40F3ADCFCCB698F4E80B9F After RSA encryption, the output is: 3D2AB25B1EB667A40F504CC4D778EC399A899C8790EDECEF062CD739492C9CE5 8B92B9ECF32AF4AAC7A61EAEC346449891F49A722378E008EFF0B0A8DBC6E621 EDC90CEC64CF34C640F5B36C48EE9322808AF8F4A0212B28715C76F3CB99AC7E 609787ADCE055839829E0142C44B676D218111FFE69F9D41424E177CBA3A435B ‣ PKCS#1 (v1.5) IN ACTION http://www.di-mgt.com.au/rsa_alg.html#pkcs1schemes
  • 96. Implementations of public keys in real life http://farm4.static.flickr.com/3538/3420164047_09ccc14e29.jpg
  • 97. Web communication public key encryption in Web communications (aka: I never use my credit card for internet purchases. It’s not safe. Instead, I gave it to the waiter who walked away with it into the kitchen for 5 minutes..)
  • 98. Web communication (1) Welcome to 1991: HTTP is plaintext. Everybody can be trusted. This page is under construction, here’s a photo of my cat and a link to geocities. ‣ BACK IN TIME
  • 100. Web communication (2) ‣ Free WiFi everywhere ‣ BUT NOW...
  • 101. Web communication (2) ‣ Free WiFi everywhere ‣ Traffic snooping ‣ BUT NOW...
  • 102. Web communication (2) ‣ Free WiFi everywhere ‣ Traffic snooping ‣ Authorization: Basic? (yes,VERY basic) ‣ BUT NOW...
  • 104. Web communication (3) ‣ HTTP encapsulated by TLS (previously SSL). ‣ USING HTTPS
  • 105. Web communication (3) ‣ HTTP encapsulated by TLS (previously SSL). ‣ More or less: an encryption layer on top of http. ‣ USING HTTPS
  • 106. Web communication (3) ‣ HTTP encapsulated by TLS (previously SSL). ‣ More or less: an encryption layer on top of http. ‣ Hybrid encryption. ‣ USING HTTPS
  • 108. Web communication (4) ‣ Actual encryption methodology is decided by the browser and the server (highest possible encryption used).
  • 109. Web communication (4) ‣ Actual encryption methodology is decided by the browser and the server (highest possible encryption used). ‣ Symmetric encryption (AES-256, others)
  • 110. Web communication (4) ‣ Actual encryption methodology is decided by the browser and the server (highest possible encryption used). ‣ Symmetric encryption (AES-256, others) ‣ But both sides needs the same key, so we have the same problem as before: how do we send over the key?
  • 112. Web communication (5) ‣ Key is exchanged in a public/private encrypted communication.
  • 113. Web communication (5) ‣ Key is exchanged in a public/private encrypted communication. ‣ Which public and private key?
  • 114. Web communication (5) ‣ Key is exchanged in a public/private encrypted communication. ‣ Which public and private key? ‣ They are stored inside the server’s SSL certificate
  • 115. Web communication (6) ‣ “GLOBAL” HTTPS HANDSHAKE
  • 116. Web communication (6) ‣ Browser sends over its encryption methods. ‣ “GLOBAL” HTTPS HANDSHAKE
  • 117. Web communication (6) ‣ Browser sends over its encryption methods. ‣ Server decides which one to use. ‣ “GLOBAL” HTTPS HANDSHAKE
  • 118. Web communication (6) ‣ Browser sends over its encryption methods. ‣ Server decides which one to use. ‣ Server send certificate(s). ‣ “GLOBAL” HTTPS HANDSHAKE
  • 119. Web communication (6) ‣ Browser sends over its encryption methods. ‣ Server decides which one to use. ‣ Server send certificate(s). ‣ Client sends “session key” encrypted by the public key found in the server certificate. ‣ “GLOBAL” HTTPS HANDSHAKE
  • 120. Web communication (6) ‣ Browser sends over its encryption methods. ‣ Server decides which one to use. ‣ Server send certificate(s). ‣ Client sends “session key” encrypted by the public key found in the server certificate. ‣ Server and client uses the “session key” for symmetrical encryption. ‣ “GLOBAL” HTTPS HANDSHAKE
  • 122. Web communication (7) ‣ Thus: Public/private encryption is only used in establishing a secondary (better!?) encryption.
  • 123. Web communication (7) ‣ Thus: Public/private encryption is only used in establishing a secondary (better!?) encryption. ‣ SSL/TLS is a separate talk (it’s way more complex as this)
  • 124. Email communication public key encryption in Email communication (aka: the worst communication method invented when it comes to privacy or secrecy, except for yelling)
  • 126. Email communication (3) ‣ DID YOU EVER SEND/RECEIVE EMAILS LIKE THIS?
  • 128. Email communication (4) ‣ Did Bill really send this email?
  • 129. Email communication (4) ‣ Did Bill really send this email? ‣ Do we know for sure that nobody has read this email (before it came to us?)
  • 130. Email communication (4) ‣ Did Bill really send this email? ‣ Do we know for sure that nobody has read this email (before it came to us?) ‣ Do we know for sure that the contents of the message isn’t tampered with?
  • 131. Email communication (4) ‣ Did Bill really send this email? ‣ Do we know for sure that nobody has read this email (before it came to us?) ‣ Do we know for sure that the contents of the message isn’t tampered with? ‣ We use signing!
  • 133. Signing (1) ‣ Signing a message means adding a signature that authenticates the validity of a message.
  • 134. Signing (1) ‣ Signing a message means adding a signature that authenticates the validity of a message. ‣ Like md5 or sha1, so when the message changes, so will the signature.
  • 135. Signing (1) ‣ Signing a message means adding a signature that authenticates the validity of a message. ‣ Like md5 or sha1, so when the message changes, so will the signature. ‣ This works on the premise that Alice and only Alice has the private key that can create the signature.
  • 138. Signing (3) ‣ GPG / PGP: Application for signing and/or encrypting data (or emails).
  • 139. Signing (3) ‣ GPG / PGP: Application for signing and/or encrypting data (or emails). ‣ Try it yourself with Thunderbird’s Enigmail extension.
  • 140. Signing (3) ‣ GPG / PGP: Application for signing and/or encrypting data (or emails). ‣ Try it yourself with Thunderbird’s Enigmail extension. ‣ Public keys can be send / found on PGP- servers so you don’t need to send your keys to everybody all the time.
  • 145. Email communication (10) ‣ ADVANTAGES OF SIGNING YOUR MAIL
  • 146. Email communication (10) ‣ Everybody can send emails that ONLY YOU can read. ‣ ADVANTAGES OF SIGNING YOUR MAIL
  • 147. Email communication (10) ‣ Everybody can send emails that ONLY YOU can read. ‣ Everybody can verify that YOU have send the email and that it is authentic. ‣ ADVANTAGES OF SIGNING YOUR MAIL
  • 148. Email communication (10) ‣ Everybody can send emails that ONLY YOU can read. ‣ Everybody can verify that YOU have send the email and that it is authentic. ‣ Why is this not the standard? ‣ ADVANTAGES OF SIGNING YOUR MAIL
  • 149. Email communication (10) ‣ Everybody can send emails that ONLY YOU can read. ‣ Everybody can verify that YOU have send the email and that it is authentic. ‣ Why is this not the standard? ‣ No really, why isn’t it the standard? ‣ ADVANTAGES OF SIGNING YOUR MAIL
  • 152. Email communication (9) Stupidity trumps everything: Don’t loose your private key(s) (as I did on multiple occasions) http://farm4.static.flickr.com/3231/2783827537_b4d2a5cc9a.jpg
  • 153. Other applications PGP / GPG (encrypt / decrypt sensitive data) OpenSSH (Secure connection to other systems) IPSEC (VPN tunnels) Software signing ‣ PUBLIC KEY ENCRYPTION IN OTHER FIELDS
  • 155. Please rate my talk on joind.in: http://joind.in/3305 ‣ THANK YOU FOR YOUR ATTENTION

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. 1. Easy to guess, brute force, note I’m saying KEY is too simple, not the Algorithm\n2. everybody can know the key\n3. Same input = same output\n\n
  20. 1. Easy to guess, brute force, note I’m saying KEY is too simple, not the Algorithm\n2. everybody can know the key\n3. Same input = same output\n\n
  21. 1. Easy to guess, brute force, note I’m saying KEY is too simple, not the Algorithm\n2. everybody can know the key\n3. Same input = same output\n\n
  22. 1. Easy to guess, brute force, note I’m saying KEY is too simple, not the Algorithm\n2. everybody can know the key\n3. Same input = same output\n\n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. This is not only true for single letters, but can also be used for complete text sentences.\n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. greatest common divisor\ne to the power of minus one\n
  78. greatest common divisor\ne to the power of minus one\n
  79. greatest common divisor\ne to the power of minus one\n
  80. greatest common divisor\ne to the power of minus one\n
  81. greatest common divisor\ne to the power of minus one\n
  82. greatest common divisor\ne to the power of minus one\n
  83. greatest common divisor\ne to the power of minus one\n
  84. greatest common divisor\ne to the power of minus one\n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n