| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132]
There was a problem hiding this comment.
Technically correct.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, although it raises some questions:
(The salt thwarts precomputed dictionary attacks; even a two-byte salt goes a long way towards mitigating that.)
Sorry, something went wrong.
|
Regardless of my understanding of the implications below, NIST is a reasonable reference and it should not be up to us to make any security recommendations.
This is a minimum recommendation so longer values are always permitted, but as salts need to be stored along with their hash values, it would be inefficient to store needlessly long salts.
Shorter salts are suited to prevent dictionary attacks, but PBKDF2 can also be used to reduce the chance of key reuse, which heavily relies on the salt length. For example, 100 operations using the same password and a two-byte salt would have a collision probability of 7%, and after 400 more operations, there is an 85% chance of having reused the same key. |
Sorry, something went wrong.
Oh, I'm not disagreeing but if you look at e.g. OWASP's recommendations, it says to use a 32 byte or even 64 byte salt. (And if you look elsewhere, you can find recommendations of as little as 4 or 8 bytes. So many options to chose from...) |
Sorry, something went wrong.
Sorry, something went wrong.
|
I guess the question here is what we personally feel like what is right to recommend. So do we want to have the current recommendation to be the same as NIST or recommend a higher value as currently? |
Sorry, something went wrong.
|
As long as we reference the NIST SP, this pull request is correct, so I am going to go ahead and land this. Apart from that, we should not make any quantitative security recommendations apart from those specified by appropriate institutions, unless they are specific to node. As @bnoordhuis pointed out, other recommendations suggest using different salt lengths, which is a fact we could mention at this point as part of the documentation. |
Sorry, something went wrong.
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: nodejs#17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
|
Landed in 560c182, thank you for your first contribution! 🎉 |
Sorry, something went wrong.
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
According to the linked document: "The length of the randomly-generated portion of the salt shall be at least 128 bits." [NIST SP 800-132] PR-URL: #17524 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
| Back | FazBrowse Home | New Git URL |
Corrects the recommended salt length recommendation in the documentation for crypto.pbkdf2 and crypto.pbkdf2Sync.
Checklist
Affected core subsystem(s)
doc