Slide 1

Slide 1 text

80,000 Plaintext Passwords @tjschuck

Slide 2

Slide 2 text

Act I

Slide 3

Slide 3 text

mallory@local$ ′

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

T.J. Schuck
 @tjschuck

Slide 6

Slide 6 text

HARVEST getHarvest.com

Slide 7

Slide 7 text

I am not a Security Expert™

Slide 8

Slide 8 text

mallory@local$ ′

Slide 9

Slide 9 text

Layers Layers Layers Layers

Slide 10

Slide 10 text

mallory@local$ perl haxor.pl ′

Slide 11

Slide 11 text

mallory@local$ perl haxor.pl ! +------+-----------------------+------------+ | id | email | password | +------+-----------------------+------------+ | 6125 | [email protected] | honeyd | | 6126 | [email protected] | blowfish | | 6127 | [email protected] | peppercorn | | 6128 | [email protected] | md1947 | +------+-----------------------+------------+

Slide 12

Slide 12 text

“But…”

Slide 13

Slide 13 text

mallory@local$ perl haxor.pl ! +------+-----------------------+------------+ | id | email | password | +------+-----------------------+------------+ | 6125 | [email protected] | honeyd | | 6126 | [email protected] | blowfish | | 6127 | [email protected] | peppercorn | | 6128 | [email protected] | md1947 | +------+-----------------------+------------+

Slide 14

Slide 14 text

mallory@local$ perl haxor.pl ! +------+-----------------------+------------+ | id | email | password | +------+-----------------------+------------+ | 6125 | [email protected] | ubarlq | | 6126 | [email protected] | oybjsvfu | | 6127 | [email protected] | crccrepbea | | 6128 | [email protected] | zq1947 | +------+-----------------------+------------+

Slide 15

Slide 15 text

Encryption is reversible

Slide 16

Slide 16 text

Hashing is irreversible

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 19

Slide 19 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘secret1234’) => bdfc2db0aa599f5919e565c328216a51

Slide 20

Slide 20 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘secret1234’) => bdfc2db0aa599f5919e565c328216a51 => 18ad6448e70b7b0254cad4d77653f2d7

Slide 21

Slide 21 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘secret1234’) => bdfc2db0aa599f5919e565c328216a51 => 18ad6448e70b7b0254cad4d77653f2d7 ?

Slide 22

Slide 22 text

Hashing is deterministic

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 25

Slide 25 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 26

Slide 26 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 27

Slide 27 text

Hashing is deterministic (but not obvious)

Slide 28

Slide 28 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f !

Slide 29

Slide 29 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f ! hash(‘Peppercorn’) => b8bfa4f1b72ee60755a71dbdf0700fe9

Slide 30

Slide 30 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f ! hash(‘Peppercorn’) => b8bfa4f1b72ee60755a71dbdf0700fe9 => b8bfa4f1b72ee60755a71dbdf0700fe8

Slide 31

Slide 31 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f ! hash(‘Peppercorn’) => b8bfa4f1b72ee60755a71dbdf0700fe9 => b8bfa4f1b72ee60755a71dbdf0700fe8 ?

Slide 32

Slide 32 text

mallory@local$ perl haxor.pl ! +------+-----------------------+----------------------------------+ | id | email | password | +------+-----------------------+----------------------------------+ | 6125 | [email protected] | 6ee717a4bc91d99170ce0d0922ab6c43 | | 6126 | [email protected] | b258a419ddbc13d92b8e7fc25c2b9d6c | | 6127 | [email protected] | 6a58d0ad2619df7d7fabc2603b79063f | | 6128 | [email protected] | 0304432f4c8080781f1b210c6b92b12f | +------+-----------------------+----------------------------------+

Slide 33

Slide 33 text

Hashing is deterministic

Slide 34

Slide 34 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Rainbow Tables

Slide 37

Slide 37 text

mallory@local$ perl haxor.pl ! +------+-----------------------+----------------------------------+ | id | email | password | +------+-----------------------+----------------------------------+ | 6125 | [email protected] | 6ee717a4bc91d99170ce0d0922ab6c43 | | 6126 | [email protected] | b258a419ddbc13d92b8e7fc25c2b9d6c | | 6127 | [email protected] | 6a58d0ad2619df7d7fabc2603b79063f | | 6128 | [email protected] | 0304432f4c8080781f1b210c6b92b12f | +------+-----------------------+----------------------------------+

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

6a58d0ad2619df7d7fabc2603b79063f

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Defeating the Rainbow

Slide 43

Slide 43 text

hash(‘peppercorn’) => 6a58d0ad2619df7d7fabc2603b79063f

Slide 44

Slide 44 text

hash(‘peppercorn-tc5gplQopZ617zRQ8h9pAg’) => c5dde1b5cc0e6d89bda0f5e350bda319

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

WE DID IT!

Slide 47

Slide 47 text

(no we didn’t)

Slide 48

Slide 48 text

Proof of Concept

Slide 49

Slide 49 text

peppercorn

Slide 50

Slide 50 text

pepper8 pepper83 pepper88 pepper99 ! pepperdog pepperi1 peppermint peppermint1 pepperoni pepperpepper peppers peppers4 peppi123 peppone pepsi pepsi1 pepsi123 pepsi2006 pepsi5 pepsi78bottle pepsicat pepsico pepsii pepsimax pepsione pepsis12 pequot per12fect peralta1 peppercorn

Slide 51

Slide 51 text

un1v3r53 1q2w#E$R fkg7h4f3v6

Slide 52

Slide 52 text

SALTING

Slide 53

Slide 53 text

SALTING

Slide 54

Slide 54 text

hash(‘peppercorn-tc5gplQopZ617zRQ8h9pAg’) => c5dde1b5cc0e6d89bda0f5e350bda319 hash(‘peppercorn-R1XrmmZVRedKMTE9nlIy9Q’) => fc5ad4a64796506086424af78f57df9d

Slide 55

Slide 55 text

mallory@local$ perl haxor.pl ! +------+----------------------------------+------------------------+ | id | password | salt | +------+----------------------------------+------------------------+ | 6125 | 5b5f47a49cdd4386611ee0a63577eccd | CeVDwwrT7saa_cY2rV_qng | | 6126 | a50f4854739e10773c99d5576dbb2f73 | rRWjkN4ioELXIPpQ6aDY4w | | 6127 | 94c91484c8bb05113b28f9da2b7ea624 | XvALmgae9uUGmpikd8sohg | | 6128 | 5d2ee837249e9340624b12e653c5e4a3 | D-ZUYoaSadkCze1fPibbgg | +------+----------------------------------+------------------------+

Slide 56

Slide 56 text

This is pretty good…

Slide 57

Slide 57 text

This is pretty good… for 1976.

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

bcrypt ✓ One-way hash
 ✓ Pre-image resistant
 ✓ Deterministic ✓ Built-in per-password salts

Slide 63

Slide 63 text

Eksblowfish

Slide 64

Slide 64 text

Adaptive Cost

Slide 65

Slide 65 text

mallory@local$ perl haxor.pl ! +-----------------------+--------------------------------------------------------------+ | email | password | +-----------------------+--------------------------------------------------------------+ | [email protected] | $2a$10$1ObnU/cPb3AjVU5iu8ntfe77xO83roRhoJMyBqYhlq5ZMMbHCcELK | | [email protected] | $2a$10$CelbCnmBjJez5ego4w.mbusfnZGOn/lRhLjrr37R0iUCr1UIC6ZyC | | [email protected] | | | [email protected] | $2a$10$9WLufYmucbh.yaTHKKUuUeihbcA3hBUiI.XiW7ygmaYcYXtl4MBKy | +-----------------------+--------------------------------------------------------------+ $ 2a 10 LrfFlMh6Yc7JWKlpRwVjUuPCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 66

Slide 66 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUuPCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 67

Slide 67 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 68

Slide 68 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 69

Slide 69 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 70

Slide 70 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 71

Slide 71 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $

Slide 72

Slide 72 text

$ 2a 10 LrfFlMh6Yc7JWKlpRwVjUu PCOPU5574fXAVrvLZRFT87cT55oLBEe $ $ “Cost”

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

bcrypt(‘peppercorn’, 10) =>

Slide 75

Slide 75 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi

Slide 76

Slide 76 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) =>

Slide 77

Slide 77 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS

Slide 78

Slide 78 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) =>

Slide 79

Slide 79 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) => $2a$14$4US.NV/qyRkctl.LaYvNzOln70yIaqGfJeMq1deb/bPJMMmtcxOU.

Slide 80

Slide 80 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) => $2a$14$4US.NV/qyRkctl.LaYvNzOln70yIaqGfJeMq1deb/bPJMMmtcxOU.

Slide 81

Slide 81 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) => $2a$14$4US.NV/qyRkctl.LaYvNzOln70yIaqGfJeMq1deb/bPJMMmtcxOU. 0.0656 seconds

Slide 82

Slide 82 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) => $2a$14$4US.NV/qyRkctl.LaYvNzOln70yIaqGfJeMq1deb/bPJMMmtcxOU. 0.0656 seconds 0.0657 seconds

Slide 83

Slide 83 text

bcrypt(‘peppercorn’, 10) => $2a$10$41JmpddjOSEGWU099uQx7O7Y1EiQMTRQFZCcFqFMlYWekR5pj9xFi bcrypt(‘peppercorn’, 10) => $2a$10$8ONmT2oiKPoPn/KQTrvHq.gWTnqQ5p.T13lw.lCm9d.QoqIZzbHPS bcrypt(‘peppercorn’, 14) => $2a$14$4US.NV/qyRkctl.LaYvNzOln70yIaqGfJeMq1deb/bPJMMmtcxOU. 0.0656 seconds 0.0657 seconds 1.0481 seconds

Slide 84

Slide 84 text

Cost Seconds 9 0.0344 10 0.0656 11 0.1333 12 0.2646 13 0.5236 14 1.0481 15 2.1645 16 4.2801

Slide 85

Slide 85 text

“Well, actually…”

Slide 86

Slide 86 text

The Fix

Slide 87

Slide 87 text

def authenticate(plaintext_password)! if old_hashing_method(plaintext_password) == password_digest! self! end! end

Slide 88

Slide 88 text

def authenticate(plaintext_password)! if BCrypt::Password.new(password_digest) == plaintext_password! self! end! end

Slide 89

Slide 89 text

def authenticate(plaintext_password)! return unless convert_old_hash_to_bcrypt(plaintext_password)! ! if BCrypt::Password.new(password_digest) == plaintext_password! self! end! end

Slide 90

Slide 90 text

def convert_old_hash_to_bcrypt(plaintext_password)! return true if BCrypt::Password.valid_hash?(password_digest)! ! if old_hashing_method(plaintext_password) == password_digest! update_column :password_digest,! BCrypt::Password.create(plaintext_password)! end! end

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

—Act II—

Slide 95

Slide 95 text

Fat Binary Gems —Act II— You make the rockin’ world go ’round

Slide 96

Slide 96 text

bcrypt-ruby github.com/codahale/bcrypt-ruby

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

No content

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Well shit.

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

rake-compiler-dev-box with Rubies, GCC, JDK, MinGW…

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

LOLOLOLOL NO.

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

rake-compiler#79

Slide 119

Slide 119 text

Act III

Slide 120

Slide 120 text

Act III Luis Lavena

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

• One-Click Ruby
 Installer for Windows

Slide 123

Slide 123 text

• One-Click Ruby
 Installer for Windows • Ruby core

Slide 124

Slide 124 text

• One-Click Ruby
 Installer for Windows • Ruby core • Ruby Hero (2010)

Slide 125

Slide 125 text

• One-Click Ruby
 Installer for Windows • Ruby core • Ruby Hero (2010) • rake-compiler

Slide 126

Slide 126 text

rake-compiler-dev-box#2

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

No content

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

@luislavena <3 <3 <3

Slide 133

Slide 133 text

Find your Luis

Slide 134

Slide 134 text

“Be the Luis you wish to see in the world”

Slide 135

Slide 135 text

What have we learned?

Slide 136

Slide 136 text

1. Just use bcrypt

Slide 137

Slide 137 text

2. Distribute a dev box

Slide 138

Slide 138 text

3. Release, collaborate, iterate

Slide 139

Slide 139 text

Thank You @tjschuck getHarvest.com