5 ms·
Once you use Encryption, it's no longer pepper, it's encryption with weak key storage (hard-coded). At that point, genuinely, why not just follow best practices
by rnovak 12y ago
Once you use Encryption, it's no longer pepper, it's encryption with weak key storage (hard-coded). At that point, genuinely, why not just follow best practices and store the key securely (e.g. using an HSM)?
- Someone1234 12y agoBecause nobody knows how to do that and it is likely extremely expensive by every metric. And, no, I am not being facetious by saying nobody knows how to do that. I am being quite literal. Have you ever done that? Do you know how? Do you even know what you would google to figure out how? I'm yet to see my favorite library of course's documentation on a HSM. How do you do that in e.g. PHP with MySQL? MVC with MS SQL? Java with Oracle?
- rnovak 12y agoIt's worth it. And yes, I have done that, it's not a mystery, they all provide a API/ABI for interacting with them[1], such as OpenSSL's Engine API or PCKS#11. Edit: There's even a project to literally do this directly from PHP[3] [1] http://stackoverflow.com/questions/10796485/interfacing-with-a-hardware-security-module-on-linux http://stackoverflow.com/questions/10796485/interfacing-with... [2] http://en.wikipedia.org/wiki/PKCS_11 http://en.wikipedia.org/wiki/PKCS_11 [3] http://stackoverflow.com/questions/3231293/how-to-interface-with-pkcs11-compliant-hsm-device-in-php http://stackoverflow.com/questions/3231293/how-to-interface-...
- MichaelGG 12y agoEh, I had a Luna CA3 sitting on my desk for a while. HSMs aren't that exotic. I'd be more concerned about the HA aspects which could require extra code. I suppose you could just shove a USB HSM in several of your servers and encrypt every password with at least 2 of them.
- Zombieball 12y agoI think AWS provides both key management services as well as cloud hsm. I have not used either myself, but I would imagine the documentation is quite good.
- girvo 12y agoChrist you weren't kidding about it being expensive. Amazons Cloud HSM is $5k upfront and $1.8/h thereafter, which is completely infeasible for the agencies I've worked at. A shame, I'd love to do the right thing there :(
- pepr 12y agoThat's why AWS also started offering Key Management Service: https://aws.amazon.com/kms/ https://aws.amazon.com/kms/ You don't get your own HSM but it's MUCH cheaper ($1/key/month) and more scalable and available than an HSM.
- girvo 12y agoThat's brilliant. I'm definitely going to use that, thanks for posting it!
- bdamm 12y agoJoining the chorus; I've done it. Expensive on some levels, but very cheap on others. Dealing with keys as physical objects is a lot less stressful.
- ShaneWilton 12y agoI've done it using a $100 Cryptostick (Now Nitrokey). Here's a guide from Mozilla: https://blog.mozilla.org/security/2013/02/13/using-cryptostick-as-an-hsm/ https://blog.mozilla.org/security/2013/02/13/using-cryptosti... https://www.nitrokey.com/ https://www.nitrokey.com/
- mirashii 12y agoCertainly storing your key with an HSM is superior and protects against a slightly large class of attacks, but in terms of getting the same protection as salt+pepper was designed for (limiting the damage of a DB-only compromise), encryption, even with weak key storage, is superior. Adding an HSM is just ways we can improve that even further (which aren't really even feasible with the salt+pepper idea).