Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using scrypt instead of bcrypt #51

Closed
garrettr opened this issue Oct 10, 2013 · 6 comments
Closed

Consider using scrypt instead of bcrypt #51

garrettr opened this issue Oct 10, 2013 · 6 comments

Comments

@garrettr
Copy link
Contributor

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
Copy link

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
Copy link

Taipo commented Dec 2, 2013

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
Copy link
Contributor Author

garrettr commented Dec 2, 2013

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

@Taipo
Copy link

Taipo commented Dec 3, 2013

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
Copy link

Taipo commented Dec 6, 2013

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 ):

  • scrypt, via its memory cost and parallelization settings, can be configured to extend the cost to the attacker, considerably past the highest practical bcrypt cost setting without incurring memory and cpu costs on the host webserver.
  • although its hard to find info on this, it appears that there is a limited password byte length for bcrypt. "Finally, the key argument is a secret encryption key, which can be a user-chosen password of up to 56 bytes (including a terminating zero byte when the key is an ASCII string)."
    from: https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node4.html
    see also: http://security.stackexchange.com/questions/39849/does-bcrypt-have-a-maximum-password-length
  • Opinion: these organisations: NSA, GCHQ, CSE of Canada and the Chinese Governments, do not publish the amount of money they have invested into building custom password-cracking units, so while 'more' might be insane in some thinking, more is better than not enough because we are largely left making guesses by comparing what is the best of the best being developed and in play currently. So it looks like we will be contending with exaflop rigs ( see links above ) in about 5 years time.
  • according to Percival, scrypt is 2⁵ times more expensive to attack than bcrypt
    from: https://www.tarsnap.com/scrypt/scrypt-slides.pdf slide 19
    So in my thinking, if those other two cost settings cannot be bypassed, then that makes scrypt the number 1 contender method for some future version of SecureDrop.

@garrettr
Copy link
Contributor Author

garrettr commented Dec 9, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants