(C) Alec Muffett's DropSafe blog.
Author Name: Alec Muffett
This story was originally published on allecmuffett.com. [1]
License: CC-BY-SA 3.0.[2]


Regulators, Password Hashing & Crypto considered as a Branding Exercise: #bcrypt #security /cc @schneierblog @glynwintle

2012-11-20 23:17:06+00:00

Pardon the rambling, mildly-edited nature of this, but: earlier this year, Whit Diffie mailed me and asked:

What is your view of BCrypt and how does it relate to the algorithm you did for Sun? I can’t recall whether yours was earlier or later, so I don’t know whether to ask why you didn’t use BCrypt.

…and I replied, cc’ing Ulrich Drepper:

Hi Whit, [cc: and Hi Ulrich] On 15 Jun 2012, at 05:19, Whitfield Diffie wrote: What is your view of BCrypt Niels Provos

Good guy

Blowfish based

Limited to [72 character] passwords but that’s OK/ish.

Good (i.e.: memory hungry) expansion phase means it’s unlikely to be put on a GPU any time real soon.**

Strong branding – relevant function name with few ambiguous clashes – unlike SHA256-FOO-PBKDF2-BAR branding of some password-hashing-friendly algorithms that confuse web developers who only hear SHA-256 and use that instead If you want to take a message to your next crypto conference, please tell them that they need to start branding their algorithms because the ignorant code monkeys get confused easily. For all of of the above reasons – especially the latter, no joke – I recommend bcrypt() to the universe for almost ALL applications of password hashing. […deletia…] and how does it relate to the algorithm you did for Sun? [It was an] Elegant, amusing hack which addresses some, perhaps most of the issues that bcrypt() does – but which suffers from: being from Oracle now

being based on MD5 which though quite legitimate in these circumstances has had its reputation trashed amongst the semi-literate security geeks

which though quite legitimate in these circumstances has had its reputation trashed amongst the semi-literate security geeks having the name SunMD5 which contains the name MD5 which – previous point aside – means people think they can use any old MD5 library and get most of the benefit for cheap; but the reputation-trashing has also done for that Had we called it hiccough or something bizarre, it might have taken off and survived to this day. I can’t recall whether yours was earlier or later, so I don’t know whether to ask why you didn’t use BCrypt. Because the point was not to come up with a new algorithm, that was just a sideline to generate some new ideas and to show off the benefits of the new Pluggable Crypt API that Casper, Darren and I designed; and it evidently worked: http://en.wikipedia.org/wiki/Crypt_(Unix)#SHA2-based_scheme The commonly used MD5 based scheme has become easier to attack as computer power has increased. Although the Blowfish-based system has the option of adding rounds and thus remain a challenging password algorithm, it does not use a NIST-approved algorithm. In light of these facts, Ulrich Drepper of Red Hat led an effort to create a scheme based on the SHA-2 (SHA-256 and SHA-512) hash functions. The printable form of these hashes starts with $5$ or $6$ depending on which SHA variant is used. Its design is similar to the MD5-based crypt, with a few notable differences: It avoids adding constant data in a few steps.

The MD5 algorithm would repeatedly add the first letter of the password; this step was changed significantly.

Inspired by Sun’s crypt() implementation, functionality to specify the number of rounds the main loop in the algorithm performs was added. The specification and sample code have been released into the public domain. …but RedHat made the cardinal mistake of calling the algorithm SHA2 which means that nobody is going to use it because normal people can’t distinguish between that and the family of other cryptographic hash functions. If they had named it bongweasel or something the community would be all over it now. Perhaps it’s time to do a Pidgin-like rebranding exercise on it?

…Drepper – being the author of the algo above – replied:

You’re missing the reasons for the new implementation and also why anything like bcrypt is completely unusable: regulators. The regulators in certain industries only “know” that MD5 == bad SHA-2 == tested and not broken any other crypto algo == [extra] work for them This is why SHA-2 was used and why having SHA in the name is necessary. I don’t say that these are good reasons. But you deal with the government and InfoSec departments…

Drepper has credentials with financial services; however I responded:

I get that; however I think it’s easy to say “ PseudoBrandableName , which is based on the SHA-2 algorithm” – compare: “ bcrypt() which is based on Blowfish” – this is not meant as a criticism of you/RedHat but I honestly believe that the wrong naming decision was made in terms of encouraging adoption. In conversations with non-cryppies (i.e.: most devs) who asked me for advice on this I several times had to go chasing after them and say “No, no! not SHA256!“, when I heard them repeating [the error] to their friends; the poor kids hear SHA-2 and their brain fills in the (incorrect) rest, and they pull in a SHA-256 library and roll their own hashes… which is disastrous. And they tell their fellow devs, which is worse. So if you don’t care to consider changing the naming that’s your decision, and I can see why. That’s fine. I wish I had named SunMD5 something better, but I did not understand this back then. But I care less about mildly confusing a supposedly-ignorant regulator than I do about fixing the certainly-ignorant free market and so will be doing what most of the UK pentester geeks I know are also doing, which is recommending Bcrypt() until such time as something better-and-unambiguous comes along; here in the UK the government agencies are adopting open-source tools to replace proprietary solutions, and because of this movement they are getting BCrypt because that’s the best we can provide them with in terms of (say) widespread support in WordPress/Drupal/Alfresco/Java/PHP. UK regulatory approval of Bcrypt() will follow in the wake of that.

So that’s what I’m thinking: we need better branding. Bcrypt() and Scrypt() is on the fringes of having a good name and having bcrypt() confused with its parental Blowfish is only acceptable because it requires particularly tenacious developer ignorance to deploy a symmetric encryption algorithm as a hashing function* without realising ones’ mistake.

And I still think “bongweasel” would be an excellent hashing algorithm name.

Footnotes:

* Yes, I do know the history of DES-based Morris crypt() and realise the irony of this sentence. But the point stands.

** Bcrypt footnote from Glyn Wintle:
[END]

[1] URL: https://alecmuffett.com/article/9439#comment-282762
[2] URL: https://creativecommons.org/licenses/by-sa/3.0/

DropSafe Blog via Magical.Fish Gopher News Feeds:
gopher://magical.fish/1/feeds/news/alecmuffett/