-
Notifications
You must be signed in to change notification settings - Fork 56
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
Remove gensalt support for obsolete hashing methods? #28
Comments
To kick off the discussion, the most obvious scenario I can think of, where people would still need to hash new passphrases with obsolete methods, is a "computer lab" with many different types of Unix workstation, using centralized authentication via NIS-style distribution of hashes. For anything weaker than SHA256, I think there's a strong case that this is no longer acceptable practice and they need to either switch to Kerberos-style ticket-based authentication (so that only the authentication server ever deals with passphrases in the first place), or upgrade or retire any computers that are limited to weaker hashing methods. Absent a published cryptographic break on Ulrich's SHA256 and SHA512 methods, I can't see dropping gensalt support for them anytime soon; you can make them take significant time by bumping up the rounds parameter, and there are a lot of Linux boxen out there still using glibc's libcrypt. |
The |
@richfelker Yes, that's right. The preferred |
For some more context, this idea came up as an alternative to the suggestion that yescrypt's gensalt should be capable of generating setting strings not only for yescrypt's current Adding support for It would certainly be weird to configure a system to use for new passwords OTOH, I do see a point in being consistent with supporting the same set of hashes for both authenticating against them and for generating them with random salts. At least this simplifies the documentation, or otherwise we need to somehow distinguish two levels of support. So I'm unsure. I'd be more in support of completely dropping the weird obsolete hashes that didn't get much adoption at all ( Speaking of bcrypt, I also see some hack value in libxcrypt optionally supporting "everything". So that e.g. the one-or-so person maybe ever wanting to migrate SunMD5 hashes to Linux can do so by using (a non-default build of?) libxcrypt. Or so that JtR's |
This came up during the review of yescrypt, but should be discussed separately.
We support generation of new "setting strings", via
crypt_gensalt
, for all of the supported hashing methods, including methods that are no longer secure (NTHASH, DES, MD5, SHA1; depending how you look at it, even SHA256 and -512 are getting shaky) and methods that exist only for backward bug-compatibility (alternative bcrypt). If we removed these, we could delete a bunch of code that exists only to support this capability, and we would eliminate a footgun (I'm especially concerned here with people passing""
as the prefix, instead of NULL, to crypt_gensalt). And it would then be consistent to provide gensalt support for yescrypt but not scrypt. However, it's conceivable that someone has a concrete need to use crypt_gensalt for obsolete methods; I don't know exactly why @besser82 implemented them in the first place, but I assume he had a use case in mind. I think we do not have a need to generate setting strings for obsolete methods in our own test suite (apart from testing the generation process itself); I can't think of any need that couldn't be met by generating setting strings by hand and embedding them in the test programs, which is what a lot of them already do.It was my intention to address this via the runtime configurability feature proposed in #4 and #26; if people could activate obsolete gensalt modes if they really need them, there would be no downside to disabling them by default. However, I have no idea when I will have time to implement that, and it certainly won't be soon, so I think there's a case for going ahead and removing the code.
For concreteness, suppose we dropped gensalt support for
""
,"_"
,"$1$"
,"$2a$"
,"$2x$"
,"$2y$"
,"$3$"
,"$md5"
, and"$sha1"
. Can anyone think of negative consequences to making that change?The text was updated successfully, but these errors were encountered: