{"id":1803,"date":"2013-03-20T09:00:53","date_gmt":"2013-03-20T13:00:53","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=1803"},"modified":"2013-03-20T09:01:07","modified_gmt":"2013-03-20T13:01:07","slug":"hashing-passwords-an-object-lesson","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=1803","title":{"rendered":"Hashing Passwords: An Object Lesson"},"content":{"rendered":"<p>Irreal regulars know that I periodically go off an a rant about the proper hashing of passwords and the dire consequences of failing to do it correctly. Not even I, however, could have imagined that <a href=\"http:\/\/arstechnica.com\/security\/2013\/03\/cisco-switches-to-weaker-hashing-scheme-passwords-cracked-wide-open\/\">Cisco would get it wrong<\/a>. And not just a little wrong but massively and totally wrong.<\/p>\n<p>In fairness, I should say up front that Cisco has acknowledged the problem and issued a <a href=\"http:\/\/tools.cisco.com\/security\/center\/content\/CiscoSecurityResponse\/cisco-sr-20130318-type4\">bulletin<\/a> on how to detect if a given piece of equipment is affected and how to deal with the problem if so. Also, Cisco is saying that the problem is an implementation, not a design issue.<\/p>\n<p>With the Cisco IOS 15 codebase, a new type of password\u2014Password Type 4\u2014was introduced. Apparently, the design called for this to be a SHA256-based PBKDF2 hash with an 80-bit salt and 1000 iterations. The idea was to replace the weaker Password Type 5, which is an MD5-based hash that was salted and repeated 1000 times. That makes sense but unfortunately the implementation merely hashed the unsalted password with SHA256 one time. The result is a password that is easily broken as demonstrated by Philipp Schmidt and Jens Steube.<\/p>\n<p>It&#8217;s hard to understand how this sort of thing could get by QA. Any time you change a cryptographic primitive it is, or should be, a big deal that requires careful scrutiny and testing. If, indeed, the design called for PBKDF2 hashing, it&#8217;s hard to see why the developer would use a single pass of SHA256 instead and how that error could get by any serious code review. If the design <i>didn&#8217;t<\/i> call for PBKDF2, it&#8217;s equally hard to understand why any developer with even a modicum of security awareness would not raise an alarm. This is not new stuff. The ideas have been around for a <i>long<\/i> time. Even the original Unix DES-based password hash from the 70s used multiple iterations and a salt.<\/p>\n<p>The lesson is clear. Unless you, too, want to be the object of near universal derision (and probably fired) use one of the accepted methods for safely storing passwords. Don&#8217;t just encrypt them, don&#8217;t just run them through a single pass of some hash, and for goodness sake don&#8217;t store them in plain text.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Irreal regulars know that I periodically go off an a rant about the proper hashing of passwords and the dire consequences of failing to do it correctly. Not even I, however, could have imagined that Cisco would get it wrong. &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=1803\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[3],"class_list":["post-1803","post","type-post","status-publish","format-standard","hentry","category-general","tag-security"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1803"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1803\/revisions"}],"predecessor-version":[{"id":1805,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1803\/revisions\/1805"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}