freedomofpress / securedrop

GitHub repository for the SecureDrop whistleblower platform. Do not submit tips here!
https://securedrop.org/
Other
3.62k stars 687 forks source link

Consider using scrypt instead of bcrypt #51

Closed garrettr closed 10 years ago

garrettr commented 11 years ago

scrypt is another adaptive key stretching algorithm in the vein of bcrypt. Unlike bcrypt, however, it was specifically designed to thwart attacks by powerful adversaries capable of building large clusters of custom hardware for password cracking. Given securedrop's threat model, scrypt might a better choice than bcrypt; however, scrypt is significantly newer and comparatively less tested.

fpietrosanti commented 11 years ago

At globaleaks we're using too scrypt by following this specific approach, described in our application security design and details: https://docs.google.com/a/apps.globaleaks.org/document/d/1SMSiAry7x5XY9nY8GAejJD75NWg7bp7M1PwXSiwy62U/pub#h.ibk1v235g7wb

Taipo commented 10 years ago

The reason I think scrypt should be eventually implemented is because of our threat model. When bcrypt was designed back in 1999 its threat was application specific hardware bruteforcing arrays. However we need to be thinking about FPGA arrays and cost to the adversary. scrypt has the potential to pretty much force an adversary to have to use FPGAs, and via the memory hardening settings you can also increase the cost factor ( for example of ram ) from a few million dollars to crack a codename in say one year, to the potential of billions of dollars.

garrettr commented 10 years ago

@taipo, do you have evidence for your claims regarding the use of FPGA arrays for cracking bcrypt?

Taipo commented 10 years ago

I derived my opinion from reading this 'STRONGER KEY DERIVATION VIA SEQUENTIAL MEMORY-HARD FUNCTIONS' From: https://www.tarsnap.com/scrypt/scrypt.pdf

Also see "Table 1. Estimated cost of hardware to crack a password in 1 year."

I am not saying that there is anything specific about scrypt that means an adversary has to use FPGAs, or that FPGA's could increase the effectiveness of determined attacks even further than ASIC's, I am looking at which method gives us the potential to make bruteforcing attempts the most expensive.

Also:

Future dev of 'supercomputers':

Taipo commented 10 years ago

One of the difficulties is finding working benchmarks for attacking scrypt key hashes. For now I can only go by information mostly authored by Colin Percival.

Summary of points where scrypt is said to get one over bcrypt ( plus some extras ):

garrettr commented 10 years ago

These are all great points and resources, thanks @Taipo! It should be pretty easy for someone to implement this using this Python library.