Slide 1

Slide 1 text

GNU Privacy Guard and you

Slide 2

Slide 2 text

ariejan https://ariejan.net

Slide 3

Slide 3 text

KABISA http://kabisa.nl

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

WHY is this YOUR problem?

Slide 6

Slide 6 text

“Just because you're paranoid doesn't mean they aren't after you” Joseph Heller, Catch-22

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

TRUST

Slide 12

Slide 12 text

HOW DOES IT WORK

Slide 13

Slide 13 text

HISTORY

Slide 14

Slide 14 text

SYMMETRIC KEY ENCRYPTION

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

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"

Slide 17

Slide 17 text

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"

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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"

Slide 20

Slide 20 text

PUBLIC KEY ENCRYPTION

Slide 21

Slide 21 text

MATH

Slide 22

Slide 22 text

Modulo 21 % 7 # => 0 23 % 7 # => 2

Slide 23

Slide 23 text

Mod-7 [0, 1, 2, 3, 4, 5, 6]

Slide 24

Slide 24 text

Greatest Common Divisor a = 10; b = 4 a.gcd(b) # => 2

Slide 25

Slide 25 text

Multiplicative Inverse x * x⁻1 = 1

Slide 26

Slide 26 text

Multiplicative Inverse 3 * x⁻1 = 1 mod 11

Slide 27

Slide 27 text

Now for the INTERESTING stuff

Slide 28

Slide 28 text

GCD(4, 9) = 1

Slide 29

Slide 29 text

4 * x⁻1 = 1 % 9

Slide 30

Slide 30 text

4 * 7 = 28 = 1 % 9

Slide 31

Slide 31 text

ϕ

Slide 32

Slide 32 text

Euler's Totient

Slide 33

Slide 33 text

For any prime number p every number from 1 up to p − 1 has a GCD of 1 with p.

Slide 34

Slide 34 text

ϕ(p) = p - 1

Slide 35

Slide 35 text

RSA

Slide 36

Slide 36 text

Rivest Shamir Adleman

Slide 37

Slide 37 text

1. Key Generation 2. RSA Function Evaluation

Slide 38

Slide 38 text

» Large Prime Number Generation » Calculate Modulus » Pick a Public Key » Calculate Private Key

Slide 39

Slide 39 text

Large Prime Number Generation

Slide 40

Slide 40 text

p = 11 q = 13

Slide 41

Slide 41 text

Calculate Modulus n = pq

Slide 42

Slide 42 text

p = 11 q = 13 n = p * q # => 143

Slide 43

Slide 43 text

Pick a Primary Key [3..ϕ(n))

Slide 44

Slide 44 text

Pick a Primary Key [3..ϕ(n)) ϕ(n)

Slide 45

Slide 45 text

Pick a Primary Key [3..ϕ(n)) ϕ(n) ϕ(p * q)

Slide 46

Slide 46 text

Pick a Primary Key [3..ϕ(n)) ϕ(n) ϕ(p * q) ϕ(p) * ϕ(q)

Slide 47

Slide 47 text

Pick a Primary Key [3..ϕ(n)) ϕ(n) ϕ(p * q) ϕ(p) * ϕ(q) p-1 * q-1

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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]

Slide 50

Slide 50 text

Generate a Private Key

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

x * x⁻1 = 1 mod y

Slide 54

Slide 54 text

e * d = 1 mod phi

Slide 55

Slide 55 text

e * d = 1 mod phi 7 * d = 1 mod 120

Slide 56

Slide 56 text

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]

Slide 57

Slide 57 text

RSA Key Pair public_key = [7, 143] private_key = [103, 143]

Slide 58

Slide 58 text

RSA Functions def encrypt(message, e, n) (message ** e) % n end def decrypt(message, d, n) (message ** d) % n end

Slide 59

Slide 59 text

Encrypt all the things encrypt(42, 7, 143) # (42 ** 7) % 143 #=> 81

Slide 60

Slide 60 text

Decryption is easy as well decrypt(81, 103, 143) # (81 ** 103) %143 #=> 42

Slide 61

Slide 61 text

Signing messages 1.Create a hash value of the message 2.Encrypt the hash value with your private key

Slide 62

Slide 62 text

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

Slide 63

Slide 63 text

WHY does RSA WORK?

Slide 64

Slide 64 text

Why does RSA work e*d = 1 mod ϕ(n)

Slide 65

Slide 65 text

LARGE numbers

Slide 66

Slide 66 text

» 2048 bit => 617 digit primes » 4096 bit => 1234 digit primes » 8192 bit => 2467 digit primes

Slide 67

Slide 67 text

NOW WHAT?!

Slide 68

Slide 68 text

» Get GPGTools for Mac » Sign your outgoing email » Create a Web of Trust

Slide 69

Slide 69 text

» Get GPGTools for Mac » Sign your outgoing email » Create a Web of Trust » Key Signing Party » Q&A Session

Slide 70

Slide 70 text

THANKS! » https://ariejan.net » [email protected] » @ariejan GPG Public Key » http://aj.gs/pubkey 8450 D928 4373 164E 25CC 7E0D AD73 9154 F713 697B