6 ms·
> Password handling (Was: scrypt or PBKDF2): In order of preference, use scrypt, bcrypt, and then if nothing else is available PBKDF2. What's the reason to pre
by JoshTriplett 12y ago
> Password handling (Was: scrypt or PBKDF2): In order of preference, use scrypt, bcrypt, and then if nothing else is available PBKDF2.
What's the reason to prefer scrypt over bcrypt? And, what's the reason to prefer both over PBKDF2? (Asking because I see quite a few bits of software that use PBKDF2.)
> Asymmetric signatures (Was: Use RSASSA-PSS with SHA256 then MGF1+SHA256 yabble babble): Use Nacl, Ed25519, or RFC6979.
Could you make a recommendation for or against using GPG, since that's by far the most common approach for asymmetric signatures? (Obviously such a recommendation would need to point at specific key/algorithm choices to use or avoid.)
> Client-server application security (Was: ship RSA keys and do custom RSA protocol) Use TLS.
Using which of the many TLS implementations?
- raverbashing 12y agoscrypt is also "space hard" I guess bcrypt is harder by default than PBKDF2
- JoshTriplett 12y ago> scrypt is also "space hard" Makes sense, thanks. > I guess bcrypt is harder by default than PBKDF2 Does that imply that software using PBKDF2 is equally safe if it turns up the difficulty?
- wolf550e 12y agoAs I understand it, this depends on the what the attacker has. If they have a FPGA or GPU, you need many rounds of PBKDF2. If you use scrypt, which was designed by cperciva to negate some of the advantages of FPGA and GPU, you don't need so many rounds to keep it hard to crack. Use https://hashcat.net/oclhashcat/ https://hashcat.net/oclhashcat/ to benchmark.
- cperciva 12y agoWhat's the reason to prefer scrypt over bcrypt? scrypt is asymptotically much more expensive to crack. And, what's the reason to prefer both over PBKDF2? scrypt is asymptotically much more expensive to crack. bcrypt is asymptotically marginally more expensive to crack than PBKDF2, but not enough to matter; I'm guessing tptacek's point here is that bcrypt has more library support available (despite PBKDF2 being the de jure standard). I wouldn't say there's a strong argument in either direction. Could you make a recommendation for or against using GPG, since that's by far the most common approach for asymmetric signatures? Avoid if possible. The code was written by a colony of drunk monkeys, in an era before anyone understood the basics of modern cryptography; I'm really not sure which is worse between gnupg and OpenSSL. Of course, GPG is the standard for encrypted email, just like SSL/TLS is the standard for web sites, so you may have no choice... (FYI: https://vuxml.freebsd.org/freebsd/pkg-gnupg.html https://vuxml.freebsd.org/freebsd/pkg-gnupg.html )
- JoshTriplett 12y ago> Avoid if possible. The code was written by a colony of drunk monkeys, in an era before anyone understood the basics of modern cryptography; I'm really not sure which is worse between gnupg and OpenSSL. Of course, GPG is the standard for encrypted email, just like SSL/TLS is the standard for web sites, so you may have no choice... Are there any viable FOSS implementations of the OpenPGP standard other than GPG? Detached GPG signatures seem to be the most common mechanism to validate software distribution and similar.
- wolf550e 12y agoHas anyone checked https://github.com/google/end-to-end https://github.com/google/end-to-end ? I want to believe google did their due diligence.
- elithrar 12y agoGo's crypto/openpgp package (http://golang.org/x/crypto/openpgp http://golang.org/x/crypto/openpgp) is probably one of the closest "full" implementations, although it's a library and not a CLI binary.
- tveita 12y ago> scrypt is asymptotically much more expensive to crack. How so? The cost of password cracking generally scales completely linearly, is there an attack on bcrypt that makes the cost sublinear? I would agree that scrypt probably has a better constant factor on typical hardware.
- mckiddy 12y agoscrypt is deliberately designed to use a large amount of memory when calculating hashes, which makes it much more difficult to parallelize using a GPU (which don't have much RAM available), hence making it much much slower to attack.
- tveita 12y agoscrypt cracking is still embarrassingly parallel even if it's hard to run on a GPU. I understand the term "asymptotically more" to refer to big O notation, where constant factors like that are ignored.
- tptacek 12y agoscrypt has nice properties that bcrypt doesn't, and gets those properties by design; it turns out that in practice right now bcrypt has some nice properties too, though they seem accidental. We're using scrypt at Starfighter, even though we have to go through a (very minor) bit of trouble to get it. They're all fine though. If using GPG means you can delegate away all your crypto design, use GPG. What you should not do is roll your own by co-opting all of GPG's design decisions, some of which are not great. You should use BoringSLL, LibreSSL, Go crypto/tls, or OpenSSL, in roughly that order.
- Canada 12y agoWhy prefer BoringSSL over LibreSSL?
- tptacek 12y agoI don't have a strong preference between the two, but have more insight into who's doing crypto work on BoringSSL than I do on LibreSSL.
- jarito 12y agoLibreSSL removed a significant portion of the optimized ASM from OpenSSL. This means that for key operations it is significantly slower.
- zimmerfrei 12y agoOptimized ASM means code that only very few people are able to review, and only with considerable time and effort. If security is the primary concern, I would argue that optimized ASM becomes a liability.
- tptacek 12y agoIt's cute that you think people review crypto C code.
- 12y ago
- baudehlo 12y agoOne of the reasons nobody has mentioned yet is that bcrypt ignores everything after the 56th character in the password. Not many people have passwords that long, but it's still relevant.
- tedunangst 12y ago72