<?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>root labs rdist &#187; Search Results  &#187;  dsa</title>
	<atom:link href="http://rdist.root.org/?s=dsa&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://rdist.root.org</link>
	<description>Embedded security, crypto, software protection</description>
	<lastBuildDate>Wed, 08 Sep 2010 22:53:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rdist.root.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/fcb2feb6139c174a88b8d38cc361a647?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>root labs rdist &#187; Search Results  &#187;  dsa</title>
		<link>http://rdist.root.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rdist.root.org/osd.xml" title="root labs rdist" />
	<atom:link rel='hub' href='http://rdist.root.org/?pushpress=hub'/>
		<item>
		<title>Crypto 2010 rump session</title>
		<link>http://rdist.root.org/2010/08/18/crypto-2010-rump-session/</link>
		<comments>http://rdist.root.org/2010/08/18/crypto-2010-rump-session/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 22:59:32 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://rdist.root.org/?p=622</guid>
		<description><![CDATA[One of the leading indicators of upcoming advances in cryptography is the rump session at the CRYPTO conference. Speakers are given 3 minutes to introduce works in progress or crack jokes. For example, I remember Paul Kocher&#8217;s groundbreaking presentation on extremely low exponent RSA (e=1). Here is more history of this casual, but important, event [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=622&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the leading indicators of upcoming advances in cryptography is the <a href="http://rump2010.cr.yp.to/">rump session at the CRYPTO conference</a>. Speakers are given 3 minutes to introduce works in progress or crack jokes. For example, I remember Paul Kocher&#8217;s groundbreaking presentation on extremely low exponent RSA (e=1). <a href="http://rump2010.cr.yp.to/submission.html">Here is more history</a> of this casual, but important, event each year.</p>
<p><a href="http://rump2010.cr.yp.to/">This year&#8217;s session</a> had some interesting talks, mostly about <a href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html">SHA-3</a> hash candidates. Dinur and Shamir announced an algebraic attack on <a href="http://homes.esat.kuleuven.be/~okucuk/hamsi/">Hamsi-256</a>, which has had other attacks announced previously. They also attacked the <a href="http://www.ecrypt.eu.org/stream/grainpf.html">Grain-128</a> stream cipher. Leurent spoke about distinguishing attacks and <a href="http://rump2010.cr.yp.to/ae6f9cc2714fbd3f342787a2d3e24af9.pdf">whether a hash function can remain secure</a> even when the underlying compression function has efficient distinguishers.</p>
<p>Cohn and Heninger <a href="http://rump2010.cr.yp.to/3d05118d2ca08d5875fb767336d7b4fb.pdf">presented</a> a survey of applications of <a href="http://www.isg.rhul.ac.uk/~sdg/crypto-book/ch21.pdf">Coppersmith&#8217;s theorem</a>, which has many uses beyond cryptanalysis of public key systems. There was a lot of interest in making public key systems resilient in the face of leakage (e.g., via side channels). This is good since traditional (EC)DSA <a href="http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/">falls apart</a> if the nonce is even partially predictable. A presentation on <a href="http://rump2010.cr.yp.to/fae8cd8265978675893352329786cea2.pdf">noisy Diffie-Hellman</a> looked interesting, although the applications are unclear to me.</p>
<p>On the implementation front, Mroczkowski <a href="http://rump2010.cr.yp.to/0f218f37f1ca88f3720efa46810407fe.pdf">described</a> a <a href="http://www.lshift.net/blog/2008/12/09/trivium-sse2-corepy-and-the-cube-attack">fast implementation of Trivium</a> in Python. It used the <a href="http://www.corepy.org/">CorePy</a> library to generate SSE3 instructions. This was to optimize the <a href="http://en.wikipedia.org/wiki/Cube_attack">cube attack</a> previously announced by Dinur and Shamir in 2008.</p>
<p>And finally, the humorous <a href="http://rump2010.cr.yp.to/d816b735a4841c9784528abfcb914920.pdf">CFP</a> for the <a href="http://www.anagram.com/~jcrap/">Journal of Craptology</a> was a great way to end. What were your favorite rump session talks?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/622/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=622&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2010/08/18/crypto-2010-rump-session/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
		<item>
		<title>Smart meter crypto flaw worse than thought</title>
		<link>http://rdist.root.org/2010/01/11/smart-meter-crypto-flaw-worse-than-thought/</link>
		<comments>http://rdist.root.org/2010/01/11/smart-meter-crypto-flaw-worse-than-thought/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 21:08:24 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[RFID]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://rdist.root.org/?p=501</guid>
		<description><![CDATA[Travis Goodspeed has continued finding flaws in TI microcontrollers, branching out from the MSP430 to ZigBee radio chipsets. A few days ago, he posted a flaw in the random number generator. Why is this important? Because the MSP430 and ZigBee are found in many wireless sensor systems, including most Smart Meters. Travis describes two flaws: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=501&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://travisgoodspeed.blogspot.com/">Travis Goodspeed</a> has continued finding flaws in TI microcontrollers, branching out from the <a href="http://focus.ti.com/mcu/docs/mcuprodoverview.tsp?sectionId=95&amp;tabId=140&amp;familyId=342">MSP430</a> to <a href="http://focus.ti.com/docs/toolsw/folders/print/z-stack.html">ZigBee</a> radio chipsets. A few days ago, he <a href="http://travisgoodspeed.blogspot.com/2009/12/prng-vulnerability-of-z-stack-zigbee.html">posted a flaw in the random number generator</a>. Why is this important? Because the MSP430 and ZigBee are found in many wireless sensor systems, including most <a href="http://en.wikipedia.org/wiki/Smart_meter">Smart Meters</a>.</p>
<p>Travis describes two flaws: the PRNG is a 16-bit <a href="http://en.wikipedia.org/wiki/Linear_feedback_shift_register">LFSR</a> and it is not seeded with very much entropy. However, the datasheet recommends this random number generator be used to create cryptographic keys. It&#8217;s extremely scary to find such a poor understanding of crypto in a device capable of forging billing records or turning off the power to your house.</p>
<p>The first flaw is that the PRNG is not cryptographically secure. The entropy pool is extremely small (16 bits), which can be attacked with a brute-force search in a fraction of a second, even if used with a secure PRNG such as Yarrow. Also, the PRNG is never re-seeded, which could have helped if implemented properly.</p>
<p>Even if the entropy pool was much larger, it would still be vulnerable because an LFSR is <a href="http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Uses_in_cryptography">not a cryptographically-secure PRNG</a>. An attacker who has seen some subset of the output can recreate the LFSR taps (even if they&#8217;re secret) and then generate any future sequence from it.</p>
<p>The second problem is that it is seeded from a random source that has very little entropy. Travis produced a <a href="http://www.flickr.com/photos/travisgoodspeed/4142689541/">frequency count graph</a> for the range of values returned by the random source, ADCTSTL, a radio register. As you can see from that graph, a few 8-bit values are returned many times (clustered around 0 and 100) and some are not returned at all. This bias could be exploited even if it was used with a cryptographically-secure PRNG.</p>
<p>These problems are each enough to make the system trivially insecure to a simple brute-force attack, as Travis points out. However, it gets worse because the insecure PRNG is used with public-key crypto. The <a href="http://focus.ti.com/docs/toolsw/folders/print/z-stack.html">Z-Stack library</a> includes <a href="http://en.wikipedia.org/wiki/Elliptic_curve_cryptography">ECC</a> code written by Certicom. I have not reviewed that code, but it seems reasonable to use a library from a company that employs cryptographers. But the ECC code makes the critical mistake of leaving implementation of primitives such as the PRNG up to the developer. Other libraries (such as OpenSSL, Mozilla&#8217;s NSS, and Microsoft&#8217;s Crypto API) all have their own PRNG, even if seeding it has to be left up to the developer. That at least reduces the risk of PRNG flaws.</p>
<p>ECC, like other public key crypto, falls on its face when the design spec is violated. In particular, <a href="http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/">ECDSA keys are completely exposed</a> if even a few bits of the random nonce are predictable. Even if the keys were securely generated in the factory during the manufacturing process, a predictable PRNG completely exposes them in the field. Since this kind of attack is based on poor entropy, it would still be possible even if TI replaced their PRNG with one that is cryptographically secure.</p>
<p>Given that these chips are used in critical infrastructure such as smart meters and this attack can be mounted from remote, it is important that it be fixed carefully. This will be difficult to fix since it will require hardware changes to the random source of entropy, and there is already an unknown number of devices in the field. Once again, <a href="http://rdist.root.org/2009/08/06/google-tech-talk-on-common-crypto-flaws/">crypto proves fragile</a> and thorough review is vital.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/501/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=501&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2010/01/11/smart-meter-crypto-flaw-worse-than-thought/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
		<item>
		<title>NaCl: DJB&#8217;s new crypto library</title>
		<link>http://rdist.root.org/2009/07/14/nacl-djbs-new-crypto-library/</link>
		<comments>http://rdist.root.org/2009/07/14/nacl-djbs-new-crypto-library/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 19:53:21 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Protocols]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://rdist.root.org/?p=395</guid>
		<description><![CDATA[NaCl is a new crypto library, courtesy of Dan Bernstein of qmail fame and Tanja Lange. After my series of posts on why crypto libraries have seriously hurt web security by offering an API that is too low-level, I was pleased to find NaCl&#8217;s main interface is high-level. In addition to the kind of fanatical [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=395&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://nacl.cace-project.eu/">NaCl</a> is a new crypto library, courtesy of <a href="http://cr.yp.to/">Dan Bernstein</a> of <a href="http://cr.yp.to/qmail.html">qmail</a> fame and <a href="http://www.hyperelliptic.org/tanja/">Tanja Lange</a>. After my <a href="http://rdist.root.org/2009/05/20/amazon-web-services-signature-vulnerability/">series</a> of <a href="http://rdist.root.org/2009/06/10/when-crypto-attacks-slides-posted/">posts</a> on why crypto libraries have seriously hurt web security by offering an API that is <a href="http://www.matasano.com/log/1749/typing-the-letters-a-e-s-into-your-code-youre-doing-it-wrong/">too low-level</a>, I was pleased to find NaCl&#8217;s main interface is high-level. In addition to the kind of fanatical attention to security you can expect from DJB, it also has his unique (some would say quirky) viewpoint.</p>
<p>On a related note, I&#8217;m sorry to say I have to withdraw my recommendation of Google <a href="http://www.keyczar.org/">Keyczar</a>. It has had another <a href="http://groups.google.com/group/keyczar-discuss/browse_thread/thread/781c4db2c0b72b36">vulnerability announced</a>, this time in the random source for the python library. This is exactly the same attack against DSA I <a href="http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/">described previously</a>. I may reconsider this decision as it matures.</p>
<p>There&#8217;s a lot Keyczar gets right. Its high-level API and key management make a lot of sense. Up until recently, there haven&#8217;t been many high-level libraries I could recommend. Gutmann&#8217;s <a href="http://www.cryptlib.com/">cryptlib</a> is probably the best one. It has been around a while and is implemented in C with multiple language bindings. It is covered by the <a href="http://www.cryptlib.com/security-faq.htm#How_is_Cryptlib_licensed_">Sleepycat license</a>, so it works like the GPL or you can pay for closed-source use. <a href="http://www.gnupg.org/gpgme.html">GPGME</a> provides well-reviewed crypto with the simple PGP usage model. However, it only offers a C API. It also works by forking the command-line gpg underneath, something that may bother some developers. It is covered by the LGPL license.</p>
<p>While cryptlib and GPGME have been around a while, I have not personally reviewed either of them and can&#8217;t vouch for their implementation security. When I found the <a href="http://rdist.root.org/2009/05/28/timing-attack-in-google-keyczar-library/">timing attack in Keyczar&#8217;s HMAC verification</a>, I took a brief look around. It seemed ok overall, but I did not do a thorough review. I was so glad to see another high-level library that I included Keyczar along with cryptlib and GPGME as a good alternative to implementing your own crypto in a <a href="http://rdist.root.org/2009/06/10/when-crypto-attacks-slides-posted/">recent talk</a>. I should have emphasized that while these libraries are taking the right approach, we need much more thorough reviews by cryptographers before standardizing on them. Keyczar, as the newest library of those three, deserved a note that it especially needed review.</p>
<p>NaCl is the latest entry on the scene and it shows a lot of promise. Take a moment to read its design <a href="http://nacl.cace-project.eu/features.html">features</a>. The code is public domain. It offers a set of high-level functions such as:</p>
<ul>
<li><a href="http://nacl.cace-project.eu/box.html">Public-key authenticated encryption</a>: establish a shared key with an authenticated partner, encrypt, and integrity-protect each message.<br />
Analogy: the SSL protocol</li>
<li><a href="http://nacl.cace-project.eu/secretbox.html">Secret-key authenticated encryption</a>: encryption and integrity protection for messages, using a pre-selected secret key.<br />
Analogy: IPSEC with encryption and authentication using a pre-shared key</li>
<li><a href="http://nacl.cace-project.eu/auth.html">Secret-key authentication</a>: integrity protection for a message using a pre-selected secret key<br />
Analogy: HMAC-protected cookies</li>
<li>Other low-level primitives such as a <a href="http://nacl.cace-project.eu/stream.html">stream cipher</a> and <a href="http://nacl.cace-project.eu/hash.html">hash</a>.</li>
</ul>
<p>There are some good things to be excited about here. The design is extremely high-speed, although that isn&#8217;t my personal priority. The high-level APIs are good but not perfect. For example, the caller is expected to specify a nonce and set certain bytes to zero for <em><a href="http://nacl.cace-project.eu/box.html">crypto_box</a></em>. This is a little too much control for a high-level API. It might be better if NaCl created its own nonce using its PRNG (/dev/urandom, actually), and then focused on making sure it was seeded well.</p>
<p>The design and implementation security, as expected for DJB, is excellent. (Note that I have not done a thorough review and thus cannot yet recommend it.) For example, he focuses on side channel resistance, creating a non-branching<a href="http://nacl.cace-project.eu/scalarmult.html"> scalar multiplication routine</a> and an <a href="http://nacl.cace-project.eu/verify.html">API for comparing secrets</a> that resists timing attacks. Also, his design choice of using ECDH, a stream cipher, and a MAC algorithm to implement <em>crypto_box</em> fit together well.</p>
<p>However, that&#8217;s where the quirkiness comes in. As with qmail, DJB has a really unique way of doing things. The default ECDH implementation uses <a href="http://cr.yp.to/papers.html#curve25519">Curve25519</a>, the stream cipher is <a href="http://cr.yp.to/papers.html#salsafamily">Salsa20</a>, and the authenticator is <a href="http://http://cr.yp.to/papers.html#poly1305">Poly1305</a>. All of these are primitives designed by DJB in the past four years. If it wasn&#8217;t DJB, you&#8217;d think I was crazy to even consider a library that implements all new ciphers and constructions. Even though I respect him and these may turn out to be good choices, four years is not enough time to review all of these to be certain they are sound. This will limit NaCl&#8217;s appeal until more standard ciphers are available.</p>
<p>While NaCl is a good start, here&#8217;s what is missing before it can be more widely adopted:</p>
<ul>
<li>Language bindings: NaCl is C-only for now and needs at least Java, python, and C# bindings</li>
<li>More standard crypto primitives: NIST P-256 or other curves, AES, and SHA2-HMAC</li>
<li>Signature API: ability to do public-key signatures</li>
</ul>
<p>Since all these items are <a href="http://nacl.cace-project.eu/features.html">marked TODO</a>, it&#8217;s clear that Dan recognizes the need for them as well. Perhaps NaCl will mature into the library of choice in the future. If you&#8217;re a cryptographer and have a chance to review it, please publish your findings. If you&#8217;re a developer, how about contributing language bindings?</p>
<p>On a side note, I&#8217;m convinced that the right way to create a crypto library is to do a single implementation in C with architecture awareness (e.g., cache layout, some assembly language) and then offer language bindings. This is the route NaCl and cryptlib took. It&#8217;s nearly impossible to prevent side channel attacks when your crypto is implemented in a high-level language.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=395&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2009/07/14/nacl-djbs-new-crypto-library/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
		<item>
		<title>The Debian PGP disaster that almost was</title>
		<link>http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/</link>
		<comments>http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/#comments</comments>
		<pubDate>Mon, 18 May 2009 01:23:17 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Protocols]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://rdist.root.org/?p=336</guid>
		<description><![CDATA[A year ago, I wrote about the Debian OpenSSL PRNG bug that reduced the entropy of its random seed to 15 bits. There was a little-noticed part of the advisory that said all DSA keys used on the affected systems should be considered compromised. In the rush to find and replace SSL certs and SSH [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=336&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A year ago, I wrote about the Debian <a href="http://rdist.root.org/2008/05/19/debian-needs-some-serious-commit-review/">OpenSSL PRNG bug</a> that reduced the entropy of its random seed to 15 bits. There was a little-noticed part of <a href="http://www.debian.org/security/2008/dsa-1571">the advisory</a> that said all DSA keys <em>used </em> on the affected systems should be considered compromised. In the rush to find and replace SSL certs and SSH keys generated on Debian or Ubuntu systems, very few people grasped the significance of this other warning. This is important because an attacker can retroactively seek out DSA signatures generated during the vulnerable period and use them to recover your private key.</p>
<p><a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">DSA</a> is a public-key signature algorithm. Unlike RSA, it isn&#8217;t useful for encryption or key exchange. Like other public key algorithms, it is extremely sensitive to the choice of parameters. I&#8217;ve written about RSA signature flaws (<a href="http://www.matasano.com/log/531/rsa-signature-forgery-explained-with-nate-lawson-wrapup/">1</a>, <a href="http://rdist.root.org/2007/05/01/rsa-public-keys-are-not-private/">2</a>, <a href="http://rdist.root.org/2007/05/03/rsa-public-keys-are-not-private-implementation/">3</a>) that resulted from too much ambiguity in how a signature verify operation was interpreted.</p>
<p>With DSA, the entropy of the random signature value <em>k</em> is critical. It is so critical that knowledge of only a few bits of <em>k</em> can reveal your entire private key to an attacker. Interestingly enough, the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">DSA</a> doesn&#8217;t mention this concern. This is why it&#8217;s so important to get your crypto reviewed by an expert. Small, obscure flaws can cause immense damage.</p>
<p>To generate a DSA signature, the signer calculates (<em>r</em>, <em>s</em>) as follows:</p>
<blockquote><p><em>r</em> = <em>g</em><sup><em>k</em></sup> mod <em>p</em> mod <em>q</em><br />
<em>s</em> = <em>k</em><sup>-1 </sup>(H(<em>m</em>) + <em>x</em>*<em>r</em>) mod <em>q</em></p></blockquote>
<p>The message to be signed is <em>m</em>, H(<em>m</em>) is the SHA hash function, and <em>p</em> and <em>q</em> are primes. The value <em>k</em> is a random nonce and <em>x</em> is the signer&#8217;s private key. If an attacker knows <em>k</em> and has a single signature (<em>r</em>, <em>s</em>), he can recover the signer&#8217;s private key with a simple calculation. In the case of the vulnerable PRNG, he can just repeat this process for all 32,767 possible values. Remember that the message <em>m</em> is not secret, so neither is the SHA-1 hash H(<em>m</em>). The attacker calculates <em>x</em> as follows:</p>
<blockquote><p><em>x</em> = ((<em>s</em> * <em>k</em>) &#8211; H(<em>m</em>)) * <em>r</em><sup>-1</sup> mod <em>q</em></p></blockquote>
<p>The impact of this attack is that every signature generated on a vulnerable system reveals the signer&#8217;s private key. An attacker can find old signatures by crawling your website, examining signed email, analyzing saved packet captures of an SSL exchange, etc. The associated DSA key has to be revoked, regenerated and redistributed. Luckily for Debian, their packages are signed using <a href="http://www.gnupg.org/">GnuPG</a>, which did not use the OpenSSL PRNG. But for anyone using other software based on OpenSSL, you need to revoke all DSA keys used to sign data on vulnerable Debian or Ubuntu systems. Even if the key was generated securely, a single insecure signature reveals the entire private key. It&#8217;s that bad.</p>
<p>I hope a year has been enough time for people to revoke their DSA keys, even though the warning was somewhat obscure. Thanks to Peter Pearson for interesting discussions about this issue.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/336/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/336/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=336&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2009/05/17/the-debian-pgp-disaster-that-almost-was/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
		<item>
		<title>Forged CA cert talk at 25C3</title>
		<link>http://rdist.root.org/2008/12/30/forged-ca-cert-talk-at-25c3/</link>
		<comments>http://rdist.root.org/2008/12/30/forged-ca-cert-talk-at-25c3/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 18:29:26 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://rdist.root.org/?p=254</guid>
		<description><![CDATA[A talk entitled &#8220;MD5 considered harmful today&#8221; (slides) is being presented at 25C3. The authors describe forging a CA cert that will be accepted by all browsers by exploiting the fact that several trusted root CAs sign certs with MD5. This allows them to spoof their identity as any SSL-enabled website on the Internet, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=254&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A talk entitled <a href="http://www.win.tue.nl/hashclash/rogue-ca/">&#8220;MD5 considered harmful today&#8221;</a> (<a href="http://phreedom.org/research/rogue-ca/md5-collisions-1.0.ppt">slides</a>) is being presented at <a href="http://events.ccc.de/congress/2008/Fahrplan/track/Hacking/3023.en.html">25C3</a>. The authors describe forging a CA cert that will be accepted by all browsers by exploiting the fact that several trusted root CAs sign certs with MD5. This allows them to spoof their identity as any SSL-enabled website on the Internet, and it will look perfectly valid to the user.</p>
<p>The growth of trusted root CAs included in standard browsers has been an issue for a while. Every root CA is equal in the eyes of the browser, thus the end-user&#8217;s security is equivalent to the security of the weakest root CA. The default Firefox install will accept a Yahoo cert signed by &#8220;TurkTrust&#8221;, or any other of more than 100 root certs. I don&#8217;t know how good each of those companies are at securing their keys, implementing strict cert chain validation, and checking the identity of every submitter. So, it&#8217;s a good bet that putting crypto authority in the hands of that many people will result in some failures, repeatedly.</p>
<p>The attack is interesting since they take advantage of more than one flaw in a CA. First, they find a CA that still uses MD5 for signing certs. MD5 has been broken for <a href="http://rdist.root.org/2008/09/15/md5-considered-primeval/">years</a>, and no CA should have been doing this. Next, they prepared an innocent-looking cert request containing the &#8220;magic values&#8221; necessary to cause an MD5 collision. They were able to do this because of a second flaw. The CA in question used an incrementing serial number instead of a random one. Since the serial is part of the signed data, it is a cheap way to get some randomness. This would have thwarted this particular attack until a pre-image vulnerability was found in MD5. Don&#8217;t count on this for security! MD4 fell to a <a href="http://www.springerlink.com/content/yut517362112765h/">second pre-image attack</a> a few years after the first collision attacks, and attacks only get better over time.</p>
<p>This talk definitely points out that crypto attacks are not being addressed quickly enough in the real world. While it is difficult to roll out a new root CA cert, it&#8217;s better to do so over the years we have known MD5 to be insecure than in a rush after an attack has already occurred. Another <a href="http://video.google.com/videoplay?docid=713763707060529304">excellent talk at 25C3 on the iPhone</a> described how the baseband processor was compromised via the <a href="http://www.matasano.com/log/558/public-key-signature-forgery-collected/">lack of validation of RSA signature padding</a>. What&#8217;s intriguing is that Apple&#8217;s own RSA implementation in their <a href="http://lists.apple.com/archives/Apple-cdsa/2006/Sep/msg00026.html">CDSA code was not vulnerable to this flaw</a>, but apparently a different vendor supplied the baseband code.</p>
<p>To paraphrase Gibson, &#8220;Crypto security is available already, it just isn&#8217;t equally distributed.&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=254&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2008/12/30/forged-ca-cert-talk-at-25c3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
		<item>
		<title>SSL design principles talk</title>
		<link>http://rdist.root.org/2007/12/17/ssl-design-principles-talk/</link>
		<comments>http://rdist.root.org/2007/12/17/ssl-design-principles-talk/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 19:12:02 +0000</pubDate>
		<dc:creator>Nate Lawson</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://rdist.root.org/2007/12/17/ssl-design-principles-talk/</guid>
		<description><![CDATA[I recently gave a talk to a networking class at Cal Poly on the design principles behind SSL. The talk was a bit basic because I had to assume the class had little security experience. My approach was to discuss how it works and stop at each phase of the protocol, asking what security flaws [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=97&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently gave a talk to a networking class at <a href="http://www.csc.calpoly.edu/about/">Cal Poly</a> on the <a href="http://www.root.org/talks/TLS_Design20071129_2.pdf">design principles behind SSL</a>.  The talk was a bit basic because I had to assume the class had little security experience.  My approach was to discuss how it works and stop at each phase of the protocol, asking what security flaws might be introduced by changing or removing elements.  This worked well to get them thinking about why SSL has certain components that appear weird at first glance but make sense after closer inspection.</p>
<p>Others have told me that they use a similar technique when learning a new crypto algorithm by starting with the simplest primitive, identifying attacks, and then adding subsequent elements until the whole algorithm is present.  If attacks still exist, the algorithm is flawed.</p>
<p>For example, consider <a href="http://en.wikipedia.org/wiki/Digital_Signature_Algorithm">DSA</a>, one of the more complex signature schemes. Use the random value <span style="font-family:courier new;">k</span> directly (instead of calculating <span style="font-family:courier new;">r = (g<sup>k </sup> mod p) mod q</span>) and the signature operation is simply:</p>
<p style="text-align:center;"><span style="font-family:courier new;"> s = k<sup>-1</sup>(H(m)) + x mod q</span></p>
<p>This introduces a fatal flaw.   <span style="font-family:courier new;">k<sup>-1</sup></span> can be calculated from <span style="font-family:courier new;">k</span> via the <a href="http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm">extended Euclidean algorithm</a>.  The message is usually known, and thus <span style="font-family:courier new;">H(m)</span> is also.  Thus, this would directly reveal the private key <span style="font-family:courier new;">x</span> to any recipient!</p>
<p>The references section at the end of the talk gives a good intro to the design principles behind SSL, especially the <a href="http://www.schneier.com/paper-ssl-revised.pdf">Wagner et al paper</a>. My next articles will explain some SSL attacks in more detail.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rdist.wordpress.com/97/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rdist.wordpress.com/97/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rdist.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rdist.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rdist.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rdist.root.org&amp;blog=893473&amp;post=97&amp;subd=rdist&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rdist.root.org/2007/12/17/ssl-design-principles-talk/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d0c01d70ede8af2f696f36d3f89b8be1?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">rdist</media:title>
		</media:content>
	</item>
	</channel>
</rss>