Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GNU Privacy Guard and You (Math Version)

GNU Privacy Guard and You (Math Version)

This talk highlights why GPG is more relevant than ever in a modern age where government spying is the norm and no one on the internet can be trusted. We also take a dive in to how the RSA public key algorithm works at its core and how you can get started with GPG *today*.

Ariejan de Vroom

May 16, 2014
Tweet

More Decks by Ariejan de Vroom

Other Decks in Technology

Transcript

  1. Symmetric Key Encryption » Convert the clear alphabet into a

    cipher alphabet. » A simple symmetric encryption key: a b c d e f g h i j k l m n o p q r s t u v w x y z | | | | | | | | | | | | | | | | | | | | | | | | | | c d e f g h i j k l m n o p q r s t u v w x y z a b "a secret massage".encrypt # => "c ugetgv ocuucig"
  2. Symmetric Key Decryption » Convert the cipher alphabet into a

    clear alphabet. » Decryption uses the same key, but in reverse. c d e f g h i j k l m n o p q r s t u v w x y z a b | | | | | | | | | | | | | | | | | | | | | | | | | | a b c d e f g h i j k l m n o p q r s t u v w x y z "c ugetgv ocuucig".decrypt # => "a secret massage"
  3. ROT13 a b c d e f g h i

    j k l m n o p q r s t u v w x y z | | | | | | | | | | | | | | | | | | | | | | | | | | n o p q r s t u v w x y z a b c d e f g h i j k l m
  4. ROT13 a b c d e f g h i

    j k l m n o p q r s t u v w x y z | | | | | | | | | | | | | | | | | | | | | | | | | | n o p q r s t u v w x y z a b c d e f g h i j k l m "Hello World".rot13.rot13.rot13.rot13 #=> "Hello World"
  5. ϕ

  6. For any prime number p every number from 1 up

    to p − 1 has a GCD of 1 with p.
  7. RSA

  8. p = 11 q = 13 n = p *

    q # 143 phi = p-1 * q-1 # 120
  9. p = 11 q = 13 n = p *

    q # 143 phi = p-1 * q-1 # 120 e = 7 # Picked from [3..phi] public_key = [e, n] # [7, 143]
  10. Generate a Private Key “Given two integers have GCD of

    1, then the smaller nummer has a multiplicative inverse in the larger mod-space.”
  11. Generate a Private Key “Given two integers have GCD of

    1, then the smaller nummer has a multiplicative inverse in the larger mod-space.” GCD(7, 120) = 1
  12. p = 11 q = 13 n = p *

    q # 143 phi = p-1 * q-1 # 120 e = 7 # Picked from [3..phi] public_key = [e, n] # [7, 143] d = extended_euclid(e, phi) private_key = [d, n] # [103, 143]
  13. RSA Functions def encrypt(message, e, n) (message ** e) %

    n end def decrypt(message, d, n) (message ** d) % n end
  14. Verifying messages 1.Create a hash value of the message 2.Decrypt

    the signature with their public key 3.Compare your and their hash values
  15. » 2048 bit => 617 digit primes » 4096 bit

    => 1234 digit primes » 8192 bit => 2467 digit primes
  16. » Get GPGTools for Mac » Sign your outgoing email

    » Create a Web of Trust » Key Signing Party » Q&A Session
  17. THANKS! » https://ariejan.net » [email protected] » @ariejan GPG Public Key

    » http://aj.gs/pubkey 8450 D928 4373 164E 25CC 7E0D AD73 9154 F713 697B