18
Applied Cryptography December 2017

Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Applied CryptographyDecember 2017

Page 2: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

2

…ECDLP is the problem of finding an ECC user's secret key, given the user's public key.

Unfortunately, there is a gap between ECDLP difficulty and ECC security….There are many attacks that break real-world ECC without solving ECDLP.

The core problem is that if you implement the standard curves, chances are you're doing it wrong.

https://safecurves.cr.yp.to/

Page 3: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

The Basics

Page 4: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Use the right primitives• Encryption != Integrity • Encryption != Authentication• Hashing != Encryption• Hashing != Irreversible (in general)

Garbled != Senseless

Page 5: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

5

Understand your cryptographic libraries• Understand their purpose• Understand their assumptions• Validate input to the libraries• Check return values

Page 6: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Side Channels

Page 7: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Crypto black box• Perform complex mathematics• Fast enough to be suitable• On general purpose hardware• Correctly for all inputs

Without any measurable side effect

Page 8: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

8

Side effects?• Data and error conditions• Processing time• Data access time• Power fluctuations• Electromagnetic emissions

Acoustic emissions

Page 9: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Password Storage

Page 10: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

What could be simpler?• Take password• Store in database• ….?• Profit!

Page 11: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

11

Step 1 – Hash it!• Get password• Store SHA256(password)• Preimage resistance for the win!

Precomputed dictionary attackEverything* falls

Page 12: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

12

Step 2 – Hash it with salt!• Get password• Store random || SHA256(random|| password)• No precomputation!

Active dictionary attackPretty much everything falls

Page 13: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

13

Step 3 – Expensive hash it with salt!• Get password• Store random || PBKDF2(random|| password)• Slow computation!

Active dictionary attack with accelerationNormal passwords fail

Page 14: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

14

Step 4 – Argon2d with salt!• Get password• Store random || argon2d(random|| password)• No acceleration!

Active dictionary attackBad passwords fail

Page 15: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

15

Step 2 – Argon2d with salt!• Get password• Store random || argon2d(random|| password)• *whew*

Denial of Service?Data independence?

Page 16: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Conclusions

Page 17: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Think big• Crypto without math is wrong• Crypto without system context also

wrong• Understand your users, your systems,

and your libraries• Secure accordingly

Page 18: Applied Cryptography - samsclass.info Cryptography.pdf · 2017-12-14 · Step 3 –Expensive hash it with salt! • Get password • Store random || PBKDF2(random|| password) •

Thank [email protected]

@scottstender