<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sam280&#039;s Blog</title>
	<atom:link href="http://sam280.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sam280.wordpress.com</link>
	<description>Just another security weblog</description>
	<lastBuildDate>Wed, 03 Feb 2010 10:44:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sam280.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sam280&#039;s Blog</title>
		<link>http://sam280.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sam280.wordpress.com/osd.xml" title="Sam280&#039;s Blog" />
	<atom:link rel='hub' href='http://sam280.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Improve your password cracking with the rockyou archive</title>
		<link>http://sam280.wordpress.com/2010/02/03/improve-your-password-cracking-with-the-rockyou-archive/</link>
		<comments>http://sam280.wordpress.com/2010/02/03/improve-your-password-cracking-with-the-rockyou-archive/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 10:44:22 +0000</pubDate>
		<dc:creator>sam280</dc:creator>
				<category><![CDATA[authentication]]></category>

		<guid isPermaLink="false">http://sam280.wordpress.com/?p=204</guid>
		<description><![CDATA[Last December rockyou.com was compromised and 32 million passwords were leaked. Imperva and others have published some basic statistics about these passwords, but much more can be learned from this archive. Indeed this material gives very valuable information about how real users choose a password, and it can help to improve your cracking rules. For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=204&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last December rockyou.com was compromised and <a href="http://www.scmagazineus.com/rockyou-hack-compromises-32-million-passwords/article/159676/">32 million passwords were leaked</a>. <a href="http://www.imperva.com/news/press/2010/01_21_Imperva_Releases_Detailed_Analysis_of_32_Million_Passwords.html">Imperva</a> and <a href="http://ptresearch.blogspot.com/2009/12/over-32-million-accounts-have-been.html">others</a> have published some basic statistics about these passwords, but much more can be learned from this archive. Indeed this material gives very valuable information about how real users choose a password, and it can help to improve your cracking rules. For instance, here are a few observations obtained by simple <em>grep</em>ing :</p>
<p><a href="http://sam280.files.wordpress.com/2010/02/pwdigits3.png"><img src="http://sam280.files.wordpress.com/2010/02/pwdigits3.png?w=471&#038;h=110" alt="" title="pwdigits" width="471" height="110" class="aligncenter size-full wp-image-235" /></a><br />
Rockyou.com users clearly love numbers: 54% of all passwords contain at least a digit and 16% of them are entirely made of digits. Out of all the passwords that contain at least a digit, 43% of them use either a single digit or two consecutive ones. 91% of users put these one or two digits at the end of their password. </p>
<p><a href="http://sam280.files.wordpress.com/2010/02/pwpunct1.png"><img src="http://sam280.files.wordpress.com/2010/02/pwpunct1.png?w=451&#038;h=109" alt="" title="pwpunct" width="451" height="109" class="aligncenter size-full wp-image-226" /></a><br />
Punctuation characters are much less popular than numbers, as less than 4% of all passwords contain at least one. When rockyou users chose a punctuation character, 21% of the time they took a &#8216;!&#8217; and 85% of the time they put it at the end.</p>
<p>Many more interesting patterns can be obtained from the rockyou archive. And all these patterns translate nicely into cracking rules for <a href="http://www.openwall.com/john/">your favourite password cracker</a> which will largely improve your cracking performances:</p>
<p><a href="http://sam280.files.wordpress.com/2010/02/pwrules.png"><img src="http://sam280.files.wordpress.com/2010/02/pwrules.png?w=470&#038;h=125" alt="" title="pwrules" width="470" height="125" class="aligncenter size-full wp-image-240" /></a></p>
<p>I believe the main problem with passwords it this: to select a password most people first pick a word or an easy sequence they can remember, <strong>and then they modify it</strong> to comply with the local password policy. But these additional modifications are very similar across people: usually digits and punctuation go to the end, while capital letters come at the beginning. Other linguistic patterns are strong: if people insert an opening parenthesis, they will most of the time close it within the same password (85% do in the rockyou archive).</p>
<p>Also people are <strong>lazy</strong>. If the password policy requires at least one capital letter, let&#8217;s use just one; after all, holding the shift key too long is kind of annoying. And if that painful administrator forces me to change my password every 2 months, why create a complete new password every time when I can just increment the last digit and pass the check ?</p>
<p>Now that large lists of real-world passwords are becoming more and more available, people are trying to automate the extraction of efficient rules from them. Two efforts worth mentioning are looking for <strong>hidden Markov models</strong> in passwords: the <a href="http://openwall.info/wiki/john/markov">Markov generator</a> by Solar Designer and the <a href="http://sites.google.com/site/reusablesec/Home/password-cracking-tools/probablistic_cracker">Probabilistic Password Cracker</a> by Matt Weir. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sam280.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sam280.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sam280.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=204&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sam280.wordpress.com/2010/02/03/improve-your-password-cracking-with-the-rockyou-archive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eebe4cd1f8c6396e94a1c189345f7fd4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sam280</media:title>
		</media:content>

		<media:content url="http://sam280.files.wordpress.com/2010/02/pwdigits3.png" medium="image">
			<media:title type="html">pwdigits</media:title>
		</media:content>

		<media:content url="http://sam280.files.wordpress.com/2010/02/pwpunct1.png" medium="image">
			<media:title type="html">pwpunct</media:title>
		</media:content>

		<media:content url="http://sam280.files.wordpress.com/2010/02/pwrules.png" medium="image">
			<media:title type="html">pwrules</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining cryptographic hashes, part 3</title>
		<link>http://sam280.wordpress.com/2010/01/25/combining-cryptographic-hashes-part-3/</link>
		<comments>http://sam280.wordpress.com/2010/01/25/combining-cryptographic-hashes-part-3/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:35:22 +0000</pubDate>
		<dc:creator>sam280</dc:creator>
				<category><![CDATA[cryptography]]></category>

		<guid isPermaLink="false">http://sam280.wordpress.com/?p=109</guid>
		<description><![CDATA[In previous posts I discussed how Joux&#8217;s multicollision attack significantly decreases the efficiency of concatenating hash functions and how it can be used to break the birthday limit of md5. Now the obvious remaining question is: if concatenation is not effective, are there better ways to combine two hash functions ? As often in cryptography, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=109&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In previous posts I discussed how Joux&#8217;s multicollision attack <a href="http://sam280.wordpress.com/2009/12/21/on-concatenating-hashes/">significantly decreases the efficiency of concatenating hash functions</a> and how it can be used to <a href="http://sam280.wordpress.com/2010/01/14/combining-cryptographic-hashes-part-2/">break the birthday limit of md5</a>. Now the obvious remaining question is: if concatenation is not effective, are there better ways to combine two hash functions ? As often in cryptography, it is very easy to come up with a solution which is neat, simple, and wrong: for instance, would you have said that <img src='http://s0.wp.com/latex.php?latex=F%28M%29+%7C%7C+G%28F%28M%29+%5Coplus+M%29+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='F(M) || G(F(M) &#92;oplus M) ' title='F(M) || G(F(M) &#92;oplus M) ' class='latex' /> is insecure ? Luckily the smart people at the <a href="http://www.minicrypt.de">Emmy Noether Research Group</a> give us two examples of good combiners.</p>
<p><strong>Hash-tree based concatenation</strong><br />
In a <a href="http://www.springerlink.com/content/x6811885283t4k78/">paper from 2007</a>, Fischlin and Lehmann introduce a security-amplifying combiner based on the concatenation combiner. Their idea is quite simple : to build a <img src='http://s0.wp.com/latex.php?latex=2%5En+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^n ' title='2^n ' class='latex' /> multicollision on an n-bits iterative hash function, Joux&#8217;s attack requires n consecutive calls to the compression function. In other words, the colliding messages must have a size equal to or larger than <img src='http://s0.wp.com/latex.php?latex=n+%2A+B+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='n * B ' title='n * B ' class='latex' /> bits, where B is the message block size of the hash function.</p>
<p>Conversely, limiting the size of the input messages would also decrease the number of multicollisions found by Joux&#8217;s attack, and therefore the probability of finding a pair of messages which collide in both hash functions. For instance, for messages of size <img src='http://s0.wp.com/latex.php?latex=n%2F4+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='n/4 ' title='n/4 ' class='latex' /> blocks, Joux&#8217;s attack can only build a <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B4%7D%7D+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{4}} ' title='2^{&#92;frac{n}{4}} ' class='latex' /> multicollision, and the probability of finding a pair of colliding messages drops to <img src='http://s0.wp.com/latex.php?latex=2%5E%7B-%5Cfrac%7Bn%7D%7B2%7D%7D+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{-&#92;frac{n}{2}} ' title='2^{-&#92;frac{n}{2}} ' class='latex' />.</p>
<p>Input messages obviously have an arbitrary size, so to ensure that the concatenation combiner <img src='http://s0.wp.com/latex.php?latex=H+%3D+F+%7C%7C+G+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H = F || G ' title='H = F || G ' class='latex' /> only process a small number of message blocks, a hash-tree structure can be used. For instance, if we decide to break the message in groups of 4 blocks the hash-tree would look like this:<br />
<img src="http://sam280.files.wordpress.com/2010/01/hashtree2.png?w=477" alt="" /><br />
The size of the groups is a tradeoff between security and speed, but you should be safe as long as you keep the groups smaller than <img src='http://s0.wp.com/latex.php?latex=n%2F4+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='n/4 ' title='n/4 ' class='latex' /> blocks.</p>
<p>
<strong>The <img src='http://s0.wp.com/latex.php?latex=C_4p+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='C_4p ' title='C_4p ' class='latex' /> combiner</strong><br />
In 2009 the same Fischlin and Lehmann introduced a <a href="http://www.springerlink.com/content/fl9g6wlu1500315g/">new family of secure combiners</a>. The basic combiner of this family is called <img src='http://s0.wp.com/latex.php?latex=C_4p+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='C_4p ' title='C_4p ' class='latex' />, and it has the following construction:<br />
<img class="aligncenter" src="http://sam280.files.wordpress.com/2010/01/c4p1.png?w=192&#038;h=256" alt="" width="192" height="256" /><br />
where:<br />
- <img src='http://s0.wp.com/latex.php?latex=H_0+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_0 ' title='H_0 ' class='latex' /> and <img src='http://s0.wp.com/latex.php?latex=H_1+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_1 ' title='H_1 ' class='latex' /> are the two hash functions to combine<br />
- <img src='http://s0.wp.com/latex.php?latex=%5Coplus+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='&#92;oplus ' title='&#92;oplus ' class='latex' /> is the XOR operator<br />
- <img src='http://s0.wp.com/latex.php?latex=H_%5Coplus+%3D+H_0+%5Coplus+H_1+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_&#92;oplus = H_0 &#92;oplus H_1 ' title='H_&#92;oplus = H_0 &#92;oplus H_1 ' class='latex' /><br />
-<img src='http://s0.wp.com/latex.php?latex=H_k%5Ei%28M%29+%3D+H_k%28i+%7C%7C+M%29+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_k^i(M) = H_k(i || M) ' title='H_k^i(M) = H_k(i || M) ' class='latex' />, in other words the binary representation of <img src='http://s0.wp.com/latex.php?latex=i+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='i ' title='i ' class='latex' /><br />
  is preprended to the message <img src='http://s0.wp.com/latex.php?latex=M+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='M ' title='M ' class='latex' /> before hashing with <img src='http://s0.wp.com/latex.php?latex=H_k+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_k ' title='H_k ' class='latex' /> (k=0 or 1)<br />
- <img src='http://s0.wp.com/latex.php?latex=H_%5Coplus%5Ei%28M%29+%3D+H_0%5Ei%28M%29+%5Coplus+H_1%5Ei%28M%29+%3D+H_0%28i%7C%7CM%29+%5Coplus+H_1%28i%7C%7CM%29+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='H_&#92;oplus^i(M) = H_0^i(M) &#92;oplus H_1^i(M) = H_0(i||M) &#92;oplus H_1(i||M) ' title='H_&#92;oplus^i(M) = H_0^i(M) &#92;oplus H_1^i(M) = H_0(i||M) &#92;oplus H_1(i||M) ' class='latex' /></p>
<p>With a combination of XOR operations, concatenations and permutations, the <img src='http://s0.wp.com/latex.php?latex=C_4p+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='C_4p ' title='C_4p ' class='latex' /> combiner outputs <img src='http://s0.wp.com/latex.php?latex=2n+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2n ' title='2n ' class='latex' />bits hash values (same length as the classical concatenation combiner) and is robust against collisions. In their article the authors describe several modifications of <img src='http://s0.wp.com/latex.php?latex=C_4p+&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='C_4p ' title='C_4p ' class='latex' /> which provide additional properties, such as pre-image robustness and indifferentiability from random oracles.</p>
<p><strong>Last words</strong><br />
In march Fischlin and Lehmann will present at the <a href="http://www.ics.mq.edu.au/conferences/ct-rsa2010/Accepted_Papers.html">CT-RSA 2010 conference</a> a paper titled <em>&#8220;Hash Function Combiners in TLS and SSL&#8221;</em>, it should be fun <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sam280.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sam280.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sam280.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=109&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sam280.wordpress.com/2010/01/25/combining-cryptographic-hashes-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eebe4cd1f8c6396e94a1c189345f7fd4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sam280</media:title>
		</media:content>

		<media:content url="http://sam280.files.wordpress.com/2010/01/hashtree2.png" medium="image" />

		<media:content url="http://sam280.files.wordpress.com/2010/01/c4p1.png" medium="image" />
	</item>
		<item>
		<title>Combining cryptographic hashes, part 2</title>
		<link>http://sam280.wordpress.com/2010/01/14/combining-cryptographic-hashes-part-2/</link>
		<comments>http://sam280.wordpress.com/2010/01/14/combining-cryptographic-hashes-part-2/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 10:05:26 +0000</pubDate>
		<dc:creator>sam280</dc:creator>
				<category><![CDATA[cryptography]]></category>

		<guid isPermaLink="false">http://sam280.wordpress.com/?p=75</guid>
		<description><![CDATA[In a previous post I discussed Joux&#8217;s multicollision attack and how it can significantly decrease the efficiency of concatenating hash functions. Today I will discuss a recent paper (December 2009) by Mendel, Rechberger and Schlaffer, which shows how specific attacks against two hash functions can be used against the concatenation combiner. Using this attack, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=75&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://sam280.wordpress.com/2009/12/21/on-concatenating-hashes/">a previous post</a> I discussed Joux&#8217;s multicollision attack and how it can significantly decrease the efficiency of concatenating hash functions. Today I will discuss <a href="http://www.springerlink.com/content/9h42u628h0l63571/">a recent paper</a> (December 2009) by Mendel, Rechberger and Schlaffer, which shows how specific attacks against two hash functions can be used against the concatenation combiner. Using this attack, the authors can find<strong> collisions in md5||SHA1 with a complexity around <img src='http://s0.wp.com/latex.php?latex=2%5E%7B59%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{59}' title='2^{59}' class='latex' /></strong>, thus breaking the <img src='http://s0.wp.com/latex.php?latex=2%5E%7B64%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{64}' title='2^{64}' class='latex' /> birthday limit.</p>
<p>First, let&#8217;s restate the old result : the cost to find collisions in F||G with Joux&#8217;s multicollision attack is <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7Bn%7D%7B2%7D.2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D+%2B+2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='&#92;frac{n}{2}.2^{&#92;frac{m}{2}} + 2^{&#92;frac{n}{2}}' title='&#92;frac{n}{2}.2^{&#92;frac{m}{2}} + 2^{&#92;frac{n}{2}}' class='latex' /> where m and n are the respective output lengths of F and G. This total is calculated by adding the cost of finding a  <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /> multicollision in F (<img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7Bn%7D%7B2%7D.2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='&#92;frac{n}{2}.2^{&#92;frac{m}{2}}' title='&#92;frac{n}{2}.2^{&#92;frac{m}{2}}' class='latex' />) and the cost of hashing these <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /> messages to find a collision in G. Now even if there were a better attack against F, this would decrease the first term of the total cost, but not the second one (the verifying step). As a result the total cost would always be higher than <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' />, so Joux&#8217;s attack is clearly not sufficient to break the birthday limit.</p>
<p>Let&#8217;s now see the new attack, and to simplify things let&#8217;s consider that m=n. The new attack is based on two assumptions:</p>
<ul>
<li>F suffers from a <strong>type-1 collision attack</strong>, meaning that given a message block m0 we can find m1 and m1&#8242; such that <img src='http://s0.wp.com/latex.php?latex=F%28m_0%7C%7Cm_1%29%3DF%28m_0%7C%7Cm_1%5Cprime%29&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='F(m_0||m_1)=F(m_0||m_1&#92;prime)' title='F(m_0||m_1)=F(m_0||m_1&#92;prime)' class='latex' /> with a complexity lower than <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /></li>
<p></p>
<li> G suffers from a <strong>type-3 collision attack</strong>, meaning that given two message blocks m2 and m2&#8242; we can find m3 such that <img src='http://s0.wp.com/latex.php?latex=G%28m_2%7C%7Cm_3%29%3DG%28m_2%5Cprime%7C%7Cm_3%29&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='G(m_2||m_3)=G(m_2&#92;prime||m_3)' title='G(m_2||m_3)=G(m_2&#92;prime||m_3)' class='latex' /> with a complexity lower than <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /></li>
</ul>
<p>The attack then goes as follows:</p>
<ol>
<li> Using the type-1 collision attack in F, find k pairs of message blocks <img src='http://s0.wp.com/latex.php?latex=%28m_1%2C...%2Cm_k%29+%28m_1%5Cprime%2C...%2Cm_k%5Cprime%29&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='(m_1,...,m_k) (m_1&#92;prime,...,m_k&#92;prime)' title='(m_1,...,m_k) (m_1&#92;prime,...,m_k&#92;prime)' class='latex' /> such that for any <img src='http://s0.wp.com/latex.php?latex=i+%5Cleq+k&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='i &#92;leq k' title='i &#92;leq k' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=F%28m_1%7C%7C...%7C%7Cm_i%29%3DF%28m_1%5Cprime%7C%7C...%7C%7Cm_i%5Cprime%29&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='F(m_1||...||m_i)=F(m_1&#92;prime||...||m_i&#92;prime)' title='F(m_1||...||m_i)=F(m_1&#92;prime||...||m_i&#92;prime)' class='latex' />. The value of k depends on the size and structure of G. Following Joux&#39; attack, this effectively gives a <img src='http://s0.wp.com/latex.php?latex=2%5Ek&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^k' title='2^k' class='latex' /> multicollision on F, in other words <img src='http://s0.wp.com/latex.php?latex=2%5Ek&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^k' title='2^k' class='latex' /> messages which hash to the same value through F.</li>
<p></p>
<li> Using these <img src='http://s0.wp.com/latex.php?latex=2%5Ek&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^k' title='2^k' class='latex' /> messages as prefix, use the type-3 collision attack on G to find a message block p such that <img src='http://s0.wp.com/latex.php?latex=G%28m_1%7C%7C...m_k%7C%7Cp%29+%3D+G%28m_1%5Cprime%7C%7C...m_k%5Cprime%7C%7Cp%29&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='G(m_1||...m_k||p) = G(m_1&#92;prime||...m_k&#92;prime||p)' title='G(m_1||...m_k||p) = G(m_1&#92;prime||...m_k&#92;prime||p)' class='latex' />. A large part of the paper describes how to perform this attack in an efficient way, using a combination of birthday techniques and differential shortcut techniques.</li>
<p></p>
<li> Finding p also gives a collision on F, as we append p to a known pair of colliding messages for F.</li>
</ol>
<p>This is the first documented attack where a weakness in two hash functions can be combined to break the birthday limit of the concatenation, and it will be interesting to see if it can be applied to other hash functions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sam280.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sam280.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sam280.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=75&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sam280.wordpress.com/2010/01/14/combining-cryptographic-hashes-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eebe4cd1f8c6396e94a1c189345f7fd4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sam280</media:title>
		</media:content>
	</item>
		<item>
		<title>O&#8217;Donnell, Cohen and the perfect anti-virus</title>
		<link>http://sam280.wordpress.com/2010/01/06/odonnell-cohen-and-the-perfect-anti-virus/</link>
		<comments>http://sam280.wordpress.com/2010/01/06/odonnell-cohen-and-the-perfect-anti-virus/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 10:38:21 +0000</pubDate>
		<dc:creator>sam280</dc:creator>
				<category><![CDATA[malware]]></category>

		<guid isPermaLink="false">http://sam280.wordpress.com/?p=26</guid>
		<description><![CDATA[Recently I stumbled upon this post where Adam O&#8217;Donnell discusses the impossibility of building a perfect anti-virus. He then pointed me to a 1984 paper by Cohen, which is apparently considered to be the first demonstration that no algorithm can correctly detect all possible computer viruses. Cohen&#8217;s proof goes like this : Let&#8217;s define a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=26&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I stumbled upon <a href="http://blog.immunet.com/blog/2009/12/23/why-anti-virus-is-hard.html">this post</a> where Adam O&#8217;Donnell discusses the impossibility of building a perfect anti-virus. He then pointed me to <a href="http://www.all.net/books/virus/part4.html">a 1984 paper by Cohen</a>, which is apparently considered to be <strong>the first demonstration that no algorithm can correctly detect all possible computer viruses</strong>. Cohen&#8217;s proof goes like this :</p>
<ol>
<li>Let&#8217;s define a computer virus as a program that can infect other programs by modifying them to include a possibly evolved copy of itself.</li>
<p></p>
<li>Let AV be a candidate virus detection algorithm. AV takes a program as input and returns true if it detected a virus, false otherwise.</li>
<p></p>
<li>Let P be a program which contains the single following pseudocode statement:
<p><em>if AV(P) exit(); else infect_others();</em></p>
<p>In other words, P calls the detection algorithm AV on itself. Provided that AV returns, two possibilities exist :</li>
<p></p>
<li>If AV(P) returns true, P exits without infecting other programs. Thus by identifying P as a virus, AV gives a <strong>false positive</strong>, since P will not act as a virus.</li>
<p></p>
<li>If AV(P) returns false, P will infect other programs. Thus AV produced a <strong>false negative</strong>, as it did not identify P as a virus, although P is one.</li>
<p></p>
<li>From 4 and 5 : in both cases AV does not return the correct result when called on P, thus AV is not a perfect virus detection algorithm.</li>
<p>
</ol>
<p>This proof is pretty weird, as it mixes up <strong>being a virus</strong> and <strong>behaving like a virus</strong>. P <em>is</em> a virus, both according to common sense and Cohen&#8217;s own definition 1 &#8212; in fact, P cannot do anything but infect other programs. Since P is obviously a virus, its detection at step 4 is <em>not</em> a false positive, even if no infection occurs during a particular run of P. So the contradiction at step 6 disappears and thus the conclusion.</p>
<p>What I find really puzzling in Cohen&#8217;s reasoning is that he considers a program P which he completely defines by its source code. But is P a virus ? Funnily enough, even with the source code Cohen cannot answer until P has been executed, as the answer depends on the output of AV(P). Contrary to his own definition, step 4 is actually based on <strong>behaviour</strong>, which is clearly not sufficient to decide if a program is a virus (<a href="http://www.cknow.com/cms/vtutor/fast-and-slow-infectors.html">slow</a>/<a href="http://www.cknow.com/cms/vtutor/sparse-infectors.html">sparse</a> infectors, <a href="http://en.wikipedia.org/wiki/Logic_bomb">logic bombs</a>, etc).</p>
<p><span style="font-weight:bold;font-size:130%;">Last words</span><br />
Not only I find Cohen&#8217;s proof very unconvincing, but I also find it quite amusing from Mr O&#8217;Donnell to use a theoretical result to argue that making good anti-viruses is difficult. Imagine a football coach asking a player to run faster, and the guy objecting : &#8220;sorry coach, but running fast is hard because there&#8217;s a theoretical limit to the speed I can reach, called C &#8230;&#8221;. In both cases I think their actual performances are much too far from the theoretical limit to use it as an excuse.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sam280.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sam280.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sam280.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=26&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sam280.wordpress.com/2010/01/06/odonnell-cohen-and-the-perfect-anti-virus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eebe4cd1f8c6396e94a1c189345f7fd4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sam280</media:title>
		</media:content>
	</item>
		<item>
		<title>On concatenating hashes</title>
		<link>http://sam280.wordpress.com/2009/12/21/on-concatenating-hashes/</link>
		<comments>http://sam280.wordpress.com/2009/12/21/on-concatenating-hashes/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:00:24 +0000</pubDate>
		<dc:creator>sam280</dc:creator>
				<category><![CDATA[cryptography]]></category>

		<guid isPermaLink="false">http://sam280.wordpress.com/?p=4</guid>
		<description><![CDATA[This post was prompted by a twit from Didier Stevens about a presentation from Bart Preneel at the OWASP Benelux conference. On slide 17, citing a 2004 paper from Joux, Dr Preneel writes that &#8220;the concatenation of 2 iterated hash functions is as most [sic] as strong as the strongest of the two (even if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=4&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post was prompted by a <a href="http://twitter.com/DidierStevens/status/6281190274">twit from Didier Stevens</a> about a <a href="http://www.owasp.org/index.php/File:Bnl09_preneel_owasp_benelux09.pdf">presentation</a> from Bart Preneel at the OWASP Benelux conference. On slide 17, citing a 2004 <a href="http://www.cs.pdx.edu/%7Eteshrim/spring06/papers/general-attacks/multi-joux.pdf">paper</a> from Joux, Dr Preneel writes that &#8220;<span style="font-weight:bold;">the concatenation of 2 iterated hash functions is as most </span>[sic]<span style="font-weight:bold;"> as strong as the strongest of the two (even if both are independent)</span>&#8220;. This was widely understood as &#8220;concatenating hashes results in an equal or lower security&#8221;, which is not really correct as this post will show.</p>
<p><strong><span style="font-size:130%;">Hash basics</span></strong><span style="font-weight:bold;"><br />
</span>A hash function is an algorithm which takes variable size input message and returns a fixed size output. For a good hash, we want three properties:</p>
<ul>
<li><span style="font-weight:bold;">collision resistance</span>: it is very difficult to find two input messages which hash to the same value.</li>
</ul>
<ul>
<li><span style="font-weight:bold;">preimage resistance</span>: given a hash value, it is very difficult to find a message which hashes to this value.</li>
</ul>
<ul>
<li><span style="font-weight:bold;">2nd preimage resistance</span>: given a message, it is very difficult to find another message which hashes to the same value.</li>
</ul>
<p>For an ideal n-bits hash, that is a hash against which no better method than exhaustive search is known, the complexity of finding a collision is <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /> (due to the <a href="http://en.wikipedia.org/wiki/Birthday_paradox">birthday paradox</a>), and the complexity of finding the first and second preimages is <img src='http://s0.wp.com/latex.php?latex=2%5En&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^n' title='2^n' class='latex' />. When concatenating two ideal hashes of n and m bits, the complexity of the combined hash becomes respectively <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%2B%5Cfrac%7Bm%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}+&#92;frac{m}{2}}' title='2^{&#92;frac{n}{2}+&#92;frac{m}{2}}' class='latex' /> for collisions and <img src='http://s0.wp.com/latex.php?latex=2%5E%7Bn%2Bm%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{n+m}' title='2^{n+m}' class='latex' /> for preimages. Finally, a k-multicollision for a given a hash function is a set of k  messages which hash to the same value. The complexity of finding a k-multicollision for an ideal n-bits hash is <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%28k-1%29%7D%7Bk%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n(k-1)}{k}}' title='2^{&#92;frac{n(k-1)}{k}}' class='latex' />.</p>
<p><span style="font-weight:bold;font-size:130%;">Iterative hashes</span><br />
Now let&#8217;s consider an ideal <span style="font-weight:bold;">iterative </span>n-bits hash function (also known as a <a href="http://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction">Merkle–Damgård construction</a>), which has the following structure :</p>
<h6><a href="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Merkle-Damgard_hash_big.svg/500px-Merkle-Damgard_hash_big.svg.png"><img style="display:block;text-align:center;cursor:pointer;width:500px;height:233px;margin:0 auto 10px;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Merkle-Damgard_hash_big.svg/500px-Merkle-Damgard_hash_big.svg.png" border="0" alt="" />source: wikipedia<br />
</a></h6>
<p>With such a function, the hash value is calculated by repeatedly iterating a compression function f over a combination of a message block and the previous output of the compression function. The first iteration of the compression function uses the first message block and a fixed initialization vector (IV). Nearly all hashes created before 2004 use this structure, including MD5, SHA-1, SHA-256, SHA-512, RIPEMD-160 and Tiger.</p>
<p><span style="font-weight:bold;font-size:130%;">Joux&#8217;s multicollision attack</span><br />
In his paper, Joux shows that the iterative structure of a hash actually helps an attacker to find multicollisions. In short, he proves that finding a <img src='http://s0.wp.com/latex.php?latex=2%5Et&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^t' title='2^t' class='latex' /> multicollision (that is, <img src='http://s0.wp.com/latex.php?latex=2%5Et&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^t' title='2^t' class='latex' /> messages which hash to the same value) only takes t times the efforts needed to find one collision. This result has a huge impact on the security of concatenated hashes, as Joux describes in the following two attacks.</p>
<p>Let&#8217;s consider two ideal iterative hash functions F and G of respective output lengths m and n bits (n &gt;= m). One can find <strong>collisions </strong>in F||G in two steps :</p>
<ol>
<li>create a <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /> multicollision in F, which has a complexity in the order of <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7Bn%7D%7B2%7D2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='&#92;frac{n}{2}2^{&#92;frac{m}{2}}' title='&#92;frac{n}{2}2^{&#92;frac{m}{2}}' class='latex' />.</li>
<li>hash these <img src='http://s0.wp.com/latex.php?latex=2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{&#92;frac{n}{2}}' title='2^{&#92;frac{n}{2}}' class='latex' /> messages with G and look for a collision. Due to the birthday paradox, there is a good chance one will occur.</li>
</ol>
<p>For a <strong>preimage </strong>attack, given two hash values Hf and Hg, we look for a message M such that F(M)=Hf and G(M)=Hg. 3 steps :</p>
<ol>
<li>create a <img src='http://s0.wp.com/latex.php?latex=2%5En&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^n' title='2^n' class='latex' /> multicollision in F, which has a complexity of <img src='http://s0.wp.com/latex.php?latex=n2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='n2^{&#92;frac{m}{2}}' title='n2^{&#92;frac{m}{2}}' class='latex' /></li>
<li>by exhaustive search, find a last block to append to one of the previous messages to obtain the desired F(M) hash value. With complexity <img src='http://s0.wp.com/latex.php?latex=2%5Em&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^m' title='2^m' class='latex' />, this gives <img src='http://s0.wp.com/latex.php?latex=2%5En&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^n' title='2^n' class='latex' /> messages which hash to the desired F(M) value</li>
<li>by exhaustive search, hash these <img src='http://s0.wp.com/latex.php?latex=2%5En&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^n' title='2^n' class='latex' /> messages and look for the desired G(M) value. Due to the birthday paradox, there&#8217;s a good chance one will occur</li>
</ol>
<p>In the end, the complexity of finding a collision in the combined hash is in the order of <img src='http://s0.wp.com/latex.php?latex=%5Cfrac%7Bn%7D%7B2%7D2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D%2B2%5E%7B%5Cfrac%7Bn%7D%7B2%7D%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='&#92;frac{n}{2}2^{&#92;frac{m}{2}}+2^{&#92;frac{n}{2}}' title='&#92;frac{n}{2}2^{&#92;frac{m}{2}}+2^{&#92;frac{n}{2}}' class='latex' /> and the complexity of finding preimages is <img src='http://s0.wp.com/latex.php?latex=n2%5E%7B%5Cfrac%7Bm%7D%7B2%7D%7D%2B2%5Em%2B2%5En&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='n2^{&#92;frac{m}{2}}+2^m+2^n' title='n2^{&#92;frac{m}{2}}+2^m+2^n' class='latex' />, which is much lower than the theoretical values. Furthermore, it is important to note that only F was required to be iterative for these attacks, no assumption was made about G to build these attacks. For instance, let&#8217;s consider two 160 bits hashes which have respective strengths of <img src='http://s0.wp.com/latex.php?latex=2%5E%7B80%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{80}' title='2^{80}' class='latex' /> against collisions and <img src='http://s0.wp.com/latex.php?latex=2%5E%7B160%7D&amp;bg=ffffe3&amp;fg=000000&amp;s=0' alt='2^{160}' title='2^{160}' class='latex' /> against preimages : by concatenating these two hashes (thus obtaining a 320 bits hash value), <span style="font-weight:bold;">the respective strengths become about 87 bits against collisions and 161 bits against preimages.</span></p>
<p><span style="font-weight:bold;font-size:130%;">Last words</span><br />
<span style="font-weight:bold;font-size:130%;"> </span>Contrary to the general interpretation of this OWASP presentation, concatenating two good hash functions (with a least one of them being iterative) does not decrease the security, but brings a very small improvement. However, two important questions remain:</p>
<ol>
<li>Joux’s attack uses the birthday paradox on ideal hashes, but what if another effective attack against one of the hashes exists ? Could concatenating a broken hash with a bad one yield a weaker security than the good hash alone ?</li>
<li>If concatenation is not effective, are there better ways to combine hashes so that the resulting combination is much stronger than any of the two ?</li>
</ol>
<p>Any idea ? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sam280.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sam280.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sam280.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sam280.wordpress.com&amp;blog=11050615&amp;post=4&amp;subd=sam280&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sam280.wordpress.com/2009/12/21/on-concatenating-hashes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eebe4cd1f8c6396e94a1c189345f7fd4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sam280</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Merkle-Damgard_hash_big.svg/500px-Merkle-Damgard_hash_big.svg.png" medium="image" />
	</item>
	</channel>
</rss>
