Linux.com

Feature: Security

Security elite hash out encryption alternatives

By Charlie Hosner on November 03, 2005 (8:00:00 AM)

Share    Print    Comments   

At this week's Cryptographic Hash Workshop in Washington, DC, the giants of the cryptography field met to discuss the problem of our disintegrating hash algorithms. Today, the security of the algorithms that protect our online banking and digital signature systems is crumbling, and no one has a simple answer to the problem.

The event kicked off with a discussion from Dr. Xiaoyun Wang of China's Shandong University, whose team's finding of practical collisions in the MD5 hash algorithm sparked a series of cracking methods that have rendered that algorithm useless for serious security implementations. Earlier this year they turned the cryptography world on its ear when they discovered weaknesses in SHA1 that reduces its protection level from 2^80 to 2^63. One could say that Dr. Wang's team is largely responsible for this collection of industry and academic giants who have converged on the NIST campus to spend two days talking about what to do with one of our favorite, and now endangered, cryptographic primitives, the hash algorithm.

Following Dr. Wang's presentation the group discussed the severity of the situation, what alternatives exist, and what guidance to give developers for the near term while the crypto community tries to plug this hole.

Heavy hitters in attendance included Bruce Schneier of Counterpane Security, Niels Ferguson of Microsoft, Whitfield Diffie of Sun Microsystems and co-creator of Diffie-Hellman Key Agreement, Eric Rescorla of TLS/SSL fame, Steven Bellovin of Columbia University, Antoine Joux of DBA and UVSQ, Hugo Krawczyk of IBM Research Center, John Kelsey of NIST and cowriter of Twofish, and Bart Preneel of KUL.

What are hashes?

Cryptographic hashes are one of the cornerstones of modern encryption systems. Bruce Schneier described them as "the workhorse of modern cryptography." Hashes are one-way mathematical functions that create a cryptographic summary of a message. You feed text into a hash function and it returns a fixed length block of cipher text that cannot be reversed back to the original message.

There are many uses for this transformation, including enabling digital signatures, protecting key distribution functions, random number generation, and providing verification for file distribution systems. Hashes are key elements in financial transaction systems, non-repudiation services, host-based intrusion detection systems, and the VPNs many people connect to every day. Everyone who uses the Internet for banking, bill paying, or purchasing is using hashing algorithms as part of the cryptographic web that protects their transactions. Hash algorithms are a key enabling technology for the Internet -- the glue that binds crypto-systems together.

The problem in depth

One of the characteristics of a good hash algorithm is the absence of collisions. A collision occurs when you run multiple original messages through a hash function and create the same summary. When this happens, you can no longer trust the algorithm to assure your information's integrity. Worse yet, attackers can use this weakness to trick your system into thinking dangerous or incorrect information is actually valid. For example, Dr. Wang's team created two PKI certificates with different information that both hash to the same MD5 summary, and that's scary.

Until Dr. Wang's team hit the scene, our leading hash algorithm, SHA1, contained no known weaknesses, offering a designed protection level of 2^80. Over the last couple years, Dr. Wang and her team have discovered vulnerabilities in SHA1 that have reduced its protection level to 2^63. This amount of protection is still outside the brute force abilities of contemporary computers, but two concerns remain. One is the increase in available computing power. We all know that Moore's Law predicts increases in computational speed by a factor of two every 18 months or so, and the appearance of bot nets well in excess of 1 million machines are moving brute force of a 2^63 key space closer to reality.

The more present danger is the fact that attacks against crypto systems never get worse, they almost always get better. The discovery of any weakness in SHA1 is likely the beginning of a full-scale dismantling of the algorithm. It might not happen next month or next year, but precedent tells us it is coming. As a reference, MD5 was released in 1991 and survived 13 years. SHA1 was released in 1993 and started showing serious weakness 12 years later. Today no one knows how much longer it has.

So what do we do? There are a few options, but none of them stands out as the clear path. Likely a combination of these choices will progress in parallel.

Write a new hash algorithm

There was more than a little talk about NIST sponsoring a contest to develop a new hash algorithm -- similar to the contest used to select the Advanced Encryption Standard (AES). Such a contest would likely yield several excellent new hash algorithms, just as the AES contest produced a stable of solid symmetric options (Twofish, Serpent, RC6, MARS). It would be great to have a fast, new, secure hash algorithm with one or two more good alternatives waiting in the wings.

Many of the conference attendees were in favor of having some pre-contest workshops to flesh out criteria that would become requirements for the next generation of hash algorithms. This is a sensible plan, as we want to really dig into what we are creating, how it will be used, and what characteristics are vital to an algorithm we want to use for the longest time possible. Unfortunately, this process takes more time, and our timeline is already getting dangerously short.

The time it takes to develop a new algorithm, bake it into vendor products, and then deploy it to the user community is estimated to be four to eight years. Many people in the crypto community don't expect SHA1 to hold together much longer than 2010, which is on the short side of that window. If we're going to go this route, we'd better giddyup. Expect to see movement in this area in the near future.

Use an existing algorithm that provides better protection

In the SHA algorithm family we still have some firepower. SHA1's big brother, SHA256, is looking good as a possible replacement for the near term. SHA256 offers much greater security than its ailing predecessor, having a designed protection factor of 2^128 which has stood up to cryptanalysis. While SHA256 isn't perfect, it is Johnny on the spot in this instance, having good protection and acceptable performance for most tasks, and lacking any other real competitors, especially in the performance area. There are a lot of secure hash algorithms out there but it's tough to make them fast.

The obvious downside to SHA256 is that it is also based on the SHA family, and cryptanalysts are already making headway into reducing its viability (the first 24 rounds have been bypassed and more are on the way). The good news is many of the current tools for breaking SHA family algorithms have been tried on SHA256 and returned limit results, so we likely have some time before it falls to the same fate as SHA1. New tools and techniques are on the horizon though, so the experts agree that SHA256 is just a bridge to a more robust solution.

One of the hard choices with picking SHA256 as a replacement is the time and expense involved in changing a primary hash algorithm. Vendors will spend huge amounts of time and money on implementing a new algorithm and will not want to make that investment in SHA256 only to find out that they need to do it again in a few years when it starts to fall apart. Complicating matters is SHA256's 256-bit block size. SHA1 is 160 bits, and there is a good bit of crypto infrastructure out there that was designed to work with 160-bit or smaller hashes. This leads us into our next option....

Fix SHA1

Several speakers presented papers on various techniques to fix the SHA1 algorithm. Most of these focused on strategies for defending against existing attacks. Unfortunately, these repairs tended to have unacceptable performance implications. Ron Rivest offered a dithering plan and Hugo Krawczyk recommended a randomization method, both of which seemed to have promise, but the leading repair idea was truncation.

There was much talk about simply creating a 256-bit hash string with SHA256, and then chopping off (truncating) 96 bits to make a 160-bit string. This will effectively create a hash that is compatible with all the current systems that work with SHA1, but avoid the collisions found in the weaker algorithm. The folks at NIST are keen on this idea, as it spells fast relief with minimal expense. And it's not a bad idea, especially as a bridge to a more robust solution, but there has been little testing of this truncation and its possible impact on cryptographic strength. While this method seems to make sense intuitively, NIST is hesitant to endorse any system that cannot be supported with a high level of assurance, or that has not been subjected to significant public review. The review is going on now, and truncation may turn out to be a decent stopgap measure.

Advice for developers and administrators

So what do you do if you're developing a system and need to make a choice on a hash algorithm right now? The guidance from a panel including Niels Ferguson, Steve Bellovin, Hugo Krawczyk, Georg Illies, and James Randell was unanimous: "Don't commit new sins." If you're developing something today, do it with SHA256. Better yet, implement your new application to be "algorithm agile," meaning plan for the reality that crypto algorithms have a relatively short lifespan and the algorithm you start with will likely become insecure before your application becomes obsolete.

For existing systems the guidance was extended: If you have legacy systems running SHA1, start working on a strategy to change them out over the next few years. And if you still have systems running MD5, run for the hills, because the sky has already fallen.

Share    Print    Comments   

Comments

on Security elite hash out encryption alternatives

Note: Comments are owned by the poster. We are not responsible for their content.

what about GnuPG & PGP

Posted by: Anonymous Coward on November 04, 2005 04:11 AM
are GnuPG and PGP encryption algorithms also under suspicion of being weak?

#

Re:what about GnuPG & PGP

Posted by: chosner on November 04, 2005 04:30 AM
GnuPG and PGP are not algorithms, they are encryption systems that incorporate a variety of algorithms into their function. Both use MD5 and SHA-1. I'm not sure about PGP, but GnuPG allows you to select Tiger or RipeMD160 as your hash options instead of MD5 or SHA-1. One more note that I should have put in the article, the HMAC construct is NOT threatened by these attacks. If you're using SHA-1, or even MD5 in an HMAC, you are NOT vulnerable.

Charlie

#

Re:what about GnuPG & PGP

Posted by: Rich Gibbs on November 04, 2005 05:00 AM
are GnuPG and PGP encryption algorithms also under suspicion of being weak?


What they were talking about primarily at this conference was cryptographic hash functions (see the sidebar in the NF article for some of their uses). So I think that, if you are talking strictly about encryption algorithms, then the ones in PGP and GnuPG are OK (with the usual caveat "as far as we know"). The algorithms supported for encryption in my version of GnuPG are:


3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH


I'm not familiar with CAST5, but the other ones are, AFAIK, OK. (3DES is triple DES; AES* are variants of the recently adopted Advanced Encryption Standard from NIST; BLOWFISH and TWOFISH are algorithms developed by Bruce Schneier.)


Incidentally, if you would like to read Schneier's take on the conference, he has comments on his blog; these are the permanent links to the entries:


<a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_1.html" title="schneier.com">http://www.schneier.com/blog/archives/2005/10/nis<nobr>t<wbr></nobr> _hash_works_1.html</a schneier.com>

<a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_2.html" title="schneier.com">http://www.schneier.com/blog/archives/2005/10/nis<nobr>t<wbr></nobr> _hash_works_2.html</a schneier.com>

<a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_3.html" title="schneier.com">http://www.schneier.com/blog/archives/2005/10/nis<nobr>t<wbr></nobr> _hash_works_3.html</a schneier.com>

<a href="http://www.schneier.com/blog/archives/2005/11/nist_hash_works.html" title="schneier.com">http://www.schneier.com/blog/archives/2005/11/nis<nobr>t<wbr></nobr> _hash_works.html</a schneier.com>

<a href="http://www.schneier.com/blog/archives/2005/11/nist_hash_works_4.html" title="schneier.com">http://www.schneier.com/blog/archives/2005/11/nis<nobr>t<wbr></nobr> _hash_works_4.html</a schneier.com>

#

ripemd

Posted by: Anonymous Coward on November 04, 2005 05:33 AM
How about RIPEMD-160 and other existing, non-SHA algorithms?

#

Re:ripemd

Posted by: chosner on November 04, 2005 07:08 AM
Not much was said about the other 160-bit algorithms. Tiger and Whirlpool have serious performance problems when compared to SHA-1. RIPEMD-160 is similar in performance (to SHA-1) with some comparisons ranking it faster and some ranking it slower. But RIPEMD is one of the algorithms Dr. Wang's team has found problems with (along with the MD/SHA families) so I would suggest that SHA-1 and RIPEMD are pretty much in the same boat.

Charlie

#

sha-512?

Posted by: Anonymous Coward on November 04, 2005 08:54 AM
Instead of SHA-256 why not just use SHA-512 for now? I think ultimatley the long term solution is a new algorithm from the ground up (as DES -> AES has and IPv4 -> IPv6 may show us).

#

Re:sha-512?

Posted by: chosner on November 04, 2005 10:10 AM
You're right, we need a new algorithm from the ground up, but we're gonna have to wait for that. SHA512 is abominably slow, like 25% the speed of SHA256. We are really looking for a balance here between acceptible security and tolerable performance. Lots of algorithms offer one or the other but not many of them have a good balance of both.

Charlie

#

The Real problem

Posted by: Anonymous Coward on November 04, 2005 07:18 PM
The real problem, is there IS a standard we go by. We need to come up with a way to be far from standard in each use.

Having everyone depend on one algorithm is stupid. People have thought md5 alone was fairly safe, an it never really was. It's just math. Then everyone sticks in the same functions and the world is running the same security algorithm.
Practically all the CMS's use it and they are run on loosely protected servers.

Great for government spying though<nobr> <wbr></nobr>:)

We need differences in programs. No one should use the same basic algorithm alone.

Theoretically. In YOUR design, invert the bits then use a SHA-256. In MY design, I invert the ascii of the users first name and multiply it by the MD5. They have to get the hash, and disect MY code to know what I did. Too many go straight to the algorithm.

At least being creative adds another level by being NON Standard.

Maybe, In a more secure design, they make x many passes, or generating a much larger value, and make people hold that hash in a memory stick.

Maybe create undeleting cookies. so only that machin in which access began has the large hashes.

I think security should have no standard, just complex algorithms and additonal manipulations of the data before or after it. Then it's up to protecting the servers and the hashes as well as the software itself.

If one program is compromised, it doesn't affect so many others. Give me some creative programming and a BIG hash.<nobr> <wbr></nobr>:)

The bottom line is, If it can be made, it can be broken. We need to add our own variables to the standards, keep the coding difficult to read, make it complex enough to take a while to reverse, and protect access to any of the above as much as we can.

BS-CHM

#

Re:The Real problem

Posted by: Anonymous Coward on November 04, 2005 09:07 PM
I think you have the terms "security" and "obscurity" confused. Security is by definition just that. It'll stand up to scrutiny and peer review. Obscurity is just smoke and mirrors. An example at the top of my head: Using SSH for remote management is security. Moving the Telnet daemon to a non-standard port is obscurity. Which would you go for?

#

Re:The Real problem

Posted by: Anonymous Coward on November 04, 2005 10:41 PM
If a hitman has your address, you can try all the security you want, eventually they will get you. If YOU can get in, so can someone else. SO, I value both equally.

#

option 3

Posted by: Anonymous Coward on November 06, 2005 09:41 PM
use ssh configured to require certificates on a wierd port. You get whatever security SSH offers plus you don't have to worry about the brain dead brute forcers consuming resources. Obscurity does buy you some aditional space, but only if you have it combined with real security. From what I understand, this is the concept the parent was trying to endorse.

#

Dr Wang

Posted by: Anonymous Coward on November 04, 2005 06:35 PM
Nice article guys. Thanks!

Interesting to note that Dr. Wang is female. Guess that showed my biases, as I had automatically assumed otherwise.

On that note, it is nice to hear about major advancements begin made by females in the field. Mathematics and computer science have a long history of being dominated by males.

#

Use both

Posted by: Mr. Sketch on November 05, 2005 12:20 AM
Why not just do SHA256 to get a strong hash and then SHA1 that hash to get the 160bit length people want?

The effective hash should still be as strong as SHA256 and maybe more so since to get a collision would require two inputs into SHA256 whose hashs yields a collision in SHA1.

#

Re:Use both

Posted by: chosner on November 05, 2005 02:17 AM
The overhead on that would be unacceptable. Truncation is substantially faster and appears to be plenty secure.

Remember, secure is easy, fast is easy, secure and fast is very difficult.

Charlie

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya