Replace bcrypt with SHA-512 password hashing#515
Conversation
**Why**: Must use FIPS approved password encryption strategy.
|
Yet another case where we get to choose between paperwork compliance and actual security, leading me to think the attack vector of most of government is just paperwork audits and not keeping attackers out and data secure. The problem is, I'd say in any normal environment that we should get the industry standard and widely reviewed We can't use common and known good algorithms because the processes involved are slow and antiquated, based on processes that were used to validate hardware based crypto. Just like our procurement policies are based on buying boots for solders, and bolts for ships, and not software. An alternative to USA #1. |
|
cc @alex |
|
Ugh, is there any way we can avoid doing this? bcrypt (or scrypt, or argon2) are industry standards for a reason: they're explicitly designed for password storage. SHA-512 isn't. It may be OK (there's some semi-convincing math here), but I am not a cryptographer and I don't particularly trust doing something that runs against a widely-acceptable best-practice without really strong understanding of what's going on. |
|
Assuming PBKDF2-HMAC-SHA512 is acceptable (with high enough iteration count), and generally what I recommend people who care about FIPS use. But it is my professional opinion that it's still not as good as If it is within your power to do so, I'd find a way to get a waiver, this is a clear case of compliance interfering with actual security. |
|
We can use PBKDF2 but will need to write an adapter. heartcombo/devise-encryptable#11 e.g. is incomplete. |
|
I agree with @alex that PBKDF2-HMAC-SHA512 is acceptable -- but honestly, only barely. I would strongly suggest seeking a waiver here, and falling back to PBKDF2-HMAC-SHA512 as a last resort. |
|
Welcome to government ;-) Some of the things done sometimes make no sense - fully agree on that point, especially when the standards are 5+ years old. Industry can move to whatever they wish, while here we have to answer to a slew of policies and regulations. OMB Circular 130A (now revised) drives all things downward, which makes NIST the official federal government standards and the FIPS it produces enforced by FISMA annuals. We use to be able to waive FIPS years ago, but FISMA explicitly prevents that for FISMA packages. As Federal IT information security and as an assessor, this statement tells me what I have to do first as "proper safeguards":
|
|
see #519 |
|
NIST SP 800-132 calls out using PBKDF2, with HMAC, and then "any approved hash function" from NIST. Several of the FIPS 140-2 approved modules support running PBKDF2 in FIPS mode as the Password-Based Key Derivation mechanism. Industry, however, is very clear of updated settings, still meeting NIST:
SOURCES: |
|
It is unacceptable to use a flat hash for passwords, especially in 2016. When FIPS 140 is a requirement with my consulting customers my recommendations was normally:
While Agron2 would be a more appropriate choice on the basis of security, the above is a reasonable position to take given the restrictions you are subject to. |
|
PBKDF2 implemented in #519 |
Why: Must use FIPS approved password encryption strategy.