<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[[SecurityRatty] tag: 256-bit]]></title>
    <link>http://securityratty.com/tag/256-bit</link>
    <description></description>
    <pubDate>Wed, 12 Dec 2007 04:35:00 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Cisco 7600 OSR Backbone Router]]></title>
      <link>http://securityratty.com/article/a447dc34e61d2770ab6d723a54abcb31</link>
      <guid>http://securityratty.com/article/a447dc34e61d2770ab6d723a54abcb31</guid>
      <description><![CDATA[For our confused CEO blogger over at StreamBase, who thinks an Internetbackbone router is the small $30 device he set up in his home office, here is a photo of a the Cisco 7600 OSR which of course...]]></description>
      <content:encoded><![CDATA[<p style="text-align: left;">For our confused CEO blogger over at StreamBase, who thinks an Internet backbone router is the small $30 device he set up in his home office, here is a photo of a the <a href="http://newsroom.cisco.com/dlls/prod_022001b.html" target="_blank">Cisco 7600 OSR</a> which of course runs <a href="http://www.cisco.com/en/US/products/sw/iosswrel/products_ios_cisco_ios_software_category_home.html" target="_blank">CISCO IOS</a>.</p>
<p style="text-align: center;"><img style="vertical-align: middle;" src="http://newsroom.cisco.com/ts_images/Cisco-7600-OSR-high.jpg" alt="Cisco 7600 OSR" height="600" /></p>
<p style="text-align: left;">The Cisco 7600 OSR consists of a 256 Gbps switching fabric and a 30 million packets per second (mpps) forwarding engine. Its breadth of IP services comes from Cisco IOS, which provides features such as security, enhanced QoS, and destination sensitive services. In addition, the Cisco 7600 OSR allows the migration of existing port adapters from Cisco 7500 series routers, via the Cisco FlexWAN module, giving service providers one the industry&#8217;s widest array of interface options in any single platform. This provides service providers great flexibility in deploying the Cisco 7600 OSR for a variety of applications, protects their investment in existing systems, and gives them a practical migration path to the New World Optical Internet.</p>
<h3>A Revolutionary Platform For Evolving Networks</h3>
<p>The Cisco 7600 OSR helps service providers break through service and bandwidth barriers today, while designing networks to scale for future growth. The Cisco 7600 OSR achieves this through &#8220;adaptive network processing,&#8221; or the ability to evolve the platform for new IP services without hardware upgrades. Unlike fixed, ASIC-based platforms, which are hardware encoded, the Cisco 7600 OSR relies on the highly flexible Parallel eXpress Forwarding (PXF) technology for scalable performance of services. PXF is a patented, Cisco-developed network processor capable of line-rate IP services delivery that can support new IP services through periodic software upgrades. Each OSM has two PXF processors capable of 12 mpps of IP services delivery per interface card.</p>
<p>&#8220;IP+Optical combines the dynamism of the Internet world with the foundation of the transport world, creating an infrastructure that can deliver the services that service providers need,&#8221; said Lele Nardin, vice president of the Internet Systems Business Unit at Cisco. &#8220;Cisco will continue to add innovative solutions on top of this solid foundation to make service providers better equipped to meet the constantly escalating and changing customer demands for new networking services.&#8221;</p>
<h3>Pricing and Availability</h3>
<p>The base Cisco 7600 OSR system is list priced at $73,000 and the entry level system, with interfaces, start at $100,000. The interfaces modules are priced between $27,000 to $180,000. The Cisco 7600 OSR is available now worldwide.</p>
]]></content:encoded>
      <pubDate>Sat, 06 Sep 2008 07:25:02 +0000</pubDate>
      <category domain="http://securityratty.com/tag/cisco">cisco</category>
      <category domain="http://securityratty.com/tag/cisco flexwan module">cisco flexwan module</category>
      <category domain="http://securityratty.com/tag/osr">osr</category>
      <category domain="http://securityratty.com/tag/runs cisco ios">runs cisco ios</category>
      <category domain="http://securityratty.com/tag/base cisco">base cisco</category>
      <category domain="http://securityratty.com/tag/cisco ios">cisco ios</category>
      <category domain="http://securityratty.com/tag/services">services</category>
      <category domain="http://securityratty.com/tag/destination sensitive services">destination sensitive services</category>
      <category domain="http://securityratty.com/tag/osr system">osr system</category>
      <source url="http://www.thecepblog.com/2008/09/06/cisco-7600-osr-backbone-router/">Cisco 7600 OSR Backbone Router</source>
    </item>
    <item>
      <title><![CDATA[Improve Security with "A Layer of Hurt"]]></title>
      <link>http://securityratty.com/article/8863df5f439aabcb64e3fc7d0777f2bf</link>
      <guid>http://securityratty.com/article/8863df5f439aabcb64e3fc7d0777f2bf</guid>
      <description><![CDATA[Hello, Michael here
I got a lot of interesting comments from my TechEd 2008 presentation entitled, &quot;How To Review Your Code And Test For Security Bugs,&quot; but the most comments and questions were...]]></description>
      <content:encoded><![CDATA[Hello, Michael here. 
<P>I got a lot of interesting comments from my <A href="http://blogs.msdn.com/sdl/archive/2008/06/26/security-thoughts-from-teched-2008.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/06/26/security-thoughts-from-teched-2008.aspx">TechEd 2008 presentation</A> entitled, "How To Review Your Code And Test For Security Bugs," but the most comments and questions were reserved for fuzz testing; I was blown away by the number of people who thought fuzz testing was hard, or that you only left fuzz testing to ‘leet hackers.</P>
<P>During the presentation I mentioned in some depth how to perform fuzz testing, and what parts of an application should be fuzz testing targets. I also introduced an idea (that's not new) to help people who have never performed fuzz testing begin fuzz testing with very little cost and friction. The idea is to add a small layer of code to an application to automatically mutate untrusted data as it comes into an application; I called that code layer "a layer of hurt."</P>
<P>Before I continue, I want to point out that fuzzing is an SDL requirement, but the idea in this blog post is not an SDL requirement, it's just another way to help meet SDL fuzzing requirements.</P>
<P>Adding a layer of hurt, as shown in the picture below, is pretty simple as it involves adding code to an application to tweak data as it comes into an application. You can work out where to place the fuzzing code by looking at your threat models to see where data crosses trust boundaries. You could also simply grep the code looking for APIs that read data, for example:</P>
<UL>
<LI>Read from files: fread, ReadFile</LI>
<LI>Reading from sockets: recv, recvfrom</LI>
<LI>For .NET code, any stream.Read</LI></UL>
<P>You get the picture.</P>
<P>The fuzzing code should appear right after the API that reads that data.</P>
<P mce_keep="true">For example, C or C++ code that reads from a UDP socket and then fuzzes the data before it's consumed by the rest of the application might look like this:</P><FONT size=1 face=Courier>
<P>char RecvBuf[1024];<BR>int&nbsp; BufLen = sizeof(RecvBuf);</P>
<P mce_keep="true">int result = recvfrom(<BR>&nbsp;&nbsp; RecvSocket, <BR>&nbsp;&nbsp; RecvBuf, <BR>&nbsp;&nbsp; BufLen, <BR>&nbsp;&nbsp; 0, <BR>&nbsp;&nbsp; (SOCKADDR *)&amp;SenderAddr, <BR>&nbsp;&nbsp; &amp;SenderAddrSize);</P></FONT><FONT size=1 face=Courier>
<P>#ifdef _FUZZ<BR>&nbsp;&nbsp; Fuzz(RecvBuf,&amp;BufLen);<BR>#endif</P></FONT>
<P>Or, in C#, code that reads from an untrusted file:</P><FONT size=1 face=Courier>
<P>FileStream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read);<BR>uint len = (uint)(fileStream.Length);<BR>byte[] fileData = new byte[fileStream.Length];<BR>fileStream.Read(fileData, 0, (int)len);<BR>fileStream.Close();</P></FONT><FONT size=1 face=Courier>
<P mce_keep="true">#if _FUZZ_<BR>&nbsp; Malform pain = new Malform();<BR>&nbsp; fileData = pain.Fuzz(fileData);<BR>#endif</P></FONT>
<P>In both code examples, Fuzz() mutates the incoming data. In the C++ case, the fuzzing code looks like this:</P><FONT size=1 face=Courier>
<P>void Fuzz(_Inout_bytecap_(*pcbBuf) char *pBuf, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _Inout_ size_t *pcbBuf) {<BR><BR>&nbsp; if (!pcbBuf || !pBuf || !*pcbBuff || *pBuf) return;<BR>&nbsp; if ((rand() % 100) &gt; 5) return; // fuzz about 5% of Buffers</P>
<P>&nbsp; size_t cLoop = 1 + (rand() % 4);</P>
<P>&nbsp; for (size_t j = 0; j &lt; cLoop; j++) {</P>
<P>&nbsp;&nbsp;&nbsp; size_t i=0,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iLow = rand() % *pcbBuf,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iHigh = 1+rand() % *pcbBuf,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iIter = 1+rand() % 8;<BR><BR>&nbsp;&nbsp;&nbsp; if (iLow &gt; iHigh)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {size_t t=iHigh; iHigh=iLow; iLow=t;}</P>
<P>&nbsp;&nbsp;&nbsp; char ch=0;<BR>&nbsp;&nbsp;&nbsp; switch(rand() % 9) {</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 0 : // reset upper bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] &amp;= 0x7F;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 1 : // set upper bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] |= 0x80;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 2 : // toggle all bits<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] ^= 0xFF;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 3 : // set to random chars<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand() % 256);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 4 : // set NULL chars to (possibly) non-NULL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!pBuf[i])&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand() % 256);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case 5 : // swap adjacent bytes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; __max(iHigh-1,iLow); i+= iIter)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {char t=pBuf[i]; pBuf[i] = pBuf[i+1]; pBuf[i+1]=t;}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 6 : // set to random chars every n-bytes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; __max(iHigh-1,iLow); i+= iIter)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = (char)(rand()%256);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 7 : // set bytes to one random char<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ch=(char)(rand() % 256);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=iLow; i &lt; iHigh; i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBuf[i] = ch;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default: // truncate stream<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pcbBuf = iHigh;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; }<BR>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P></FONT>
<P>The sample C# and C++ fuzzing code is available as a ZIP file at the end of this post.</P>
<P>This code is an example of dumb-fuzzing, which is fuzzing with little or no regard for the data structure being manipulated. If you've never performed any kind of fuzz testing in the past, then you will probably find bugs with this simple fuzzing technique. Once you have weeded out the low-hanging bugs, you may need to turn your attention to smarter fuzzers. For example, in theory, this code would find few if any bugs in a PNG parser, because PNG files have a built in check-sum, so if you fuzz a PNG file, you'd have to recalculate the checksum to get decent code coverage.</P>
<P>When I showed this code during my presentation, I urged people to add it to their applications today if they currently don't do fuzz testing, and simply run their applications through their normal testing processes. Within three days of my presentation I received emails from people saying they had found bugs. I have no doubt others did too.</P>
<P>One of the comments I made during the session was,"If you can't spend the time on great fuzzing, fuzz anyway" and adding a "layer of hurt" is a reasonable start.</P>
<P>Please feel free to sound off if you have ideas to help improve the code and let us know what you think, either through email or comments to this post.</P><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8794487" width="1" height="1">]]></content:encoded>
      <pubDate>Thu, 31 Jul 2008 15:13:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/layer">layer</category>
      <category domain="http://securityratty.com/tag/code layer">code layer</category>
      <category domain="http://securityratty.com/tag/code">code</category>
      <category domain="http://securityratty.com/tag/decent code coverage">decent code coverage</category>
      <category domain="http://securityratty.com/tag/fuzz">fuzz</category>
      <category domain="http://securityratty.com/tag/void fuzz">void fuzz</category>
      <category domain="http://securityratty.com/tag/ifdef fuzz">ifdef fuzz</category>
      <category domain="http://securityratty.com/tag/code examples">code examples</category>
      <category domain="http://securityratty.com/tag/perform fuzz">perform fuzz</category>
      <source url="http://blogs.msdn.com/sdl/archive/2008/07/31/improve-security-with-a-layer-of-hurt.aspx">Improve Security with "A Layer of Hurt"</source>
    </item>
    <item>
      <title><![CDATA[Bull crams crypto chips into bootable USB hard disk drive]]></title>
      <link>http://securityratty.com/article/26787010701e87778d5748ef0d91a91a</link>
      <guid>http://securityratty.com/article/26787010701e87778d5748ef0d91a91a</guid>
      <description><![CDATA[French IT company Bull has fitted a portable hard drive with a cryptographic processor capable of scrambling data on the fly at 100Mbit/sec. using AES-256...]]></description>
      <content:encoded><![CDATA[French IT company Bull has fitted a portable hard drive with a cryptographic processor capable of scrambling data on the fly at 100Mbit/sec. using AES-256 encryption.
<p><a href="http://feeds.computerworld.com/~a/Computerworld/Security/News?a=XkAxhO"><img src="http://feeds.computerworld.com/~a/Computerworld/Security/News?i=XkAxhO" border="0"></img></a></p><img src="http://feeds.computerworld.com/~r/Computerworld/Security/News/~4/273094740" height="1" width="1"/>]]></content:encoded>
      <pubDate>Fri, 18 Apr 2008 09:00:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/cryptographic processor capable">cryptographic processor capable</category>
      <category domain="http://securityratty.com/tag/portable hard drive">portable hard drive</category>
      <category domain="http://securityratty.com/tag/company bull">company bull</category>
      <category domain="http://securityratty.com/tag/aes-256 encryption">aes-256 encryption</category>
      <category domain="http://securityratty.com/tag/french">french</category>
      <category domain="http://securityratty.com/tag/100mbitsec">100mbitsec</category>
      <category domain="http://securityratty.com/tag/data">data</category>
      <source url="http://feeds.computerworld.com/~r/Computerworld/Security/News/~3/273094740/article.do">Bull crams crypto chips into bootable USB hard disk drive</source>
    </item>
    <item>
      <title><![CDATA[Got Entropy ?]]></title>
      <link>http://securityratty.com/article/e241bfde32ce971a3341a22fcb76c27d</link>
      <guid>http://securityratty.com/article/e241bfde32ce971a3341a22fcb76c27d</guid>
      <description><![CDATA[So I have been planning a series of podcasts on Cryptographic Controls. In the process of this planning, I fell into one of the classic traps that crypto-geeks fall into: obsessing about random number...]]></description>
      <content:encoded><![CDATA[<p>So I have been planning a series of podcasts on Cryptographic Controls. In the process of this planning, I fell into one of the classic traps that crypto-geeks fall into: obsessing about random number  generators (RNGs).</p>
<p><em>(FYI, for the impatient, <a href="http://gotentropy.artofinfosec.com/" >click here</a>.)<br />
</em></p>
<p>There are two ways to generate random numbers on computers: (1) use a software program called a Pseudorandom Number Generator (PRNG) or (2) use a hardware random number generator. A Pseudorandom Number Generator uses a seed value to generate a sequence of numbers that appear random. The problem is that the same seed generates the same random sequence. The hardware based RNG observes and samples some physical phenomenon which is random, such as cosmic rays, RF noise, etc. (aka Entropy).</p>
<p>RNGs are important in Information Security because they are used to generate encryption keys, salts, etc. Historically, attacking RNGs has proven effective, such as the defeat of <a href="http://community.webreview.com/windows/184409807" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://community.webreview.com/windows/184409807');">Netscape&#8217;s HTTPS sessions</a>.</p>
<p>Most operating systems utilize a hybrid approach, implementing a PseudoRandom Number Generator that has a seed that is regularly updated through the collection of random hardware events. This process is called Entropy Collection or Entropy Harvesting. <strong>For most applications, this approach should be completely sufficient.</strong> However, one of the key assumptions is that the operating system has been up and running long enough for the seed value itself to become hard to predict through the collection of Entropy. Also, many of the Entropy collecting events come from properties of hardware devices, such as the minor variations in hard drive rate of rotation. As such, there are a few circumstances where the OS RNG may not be good enough for strong cryptographic key generation:</p>
<ul>
<li>Live Boot CD ( The start state of the RNG may be predictable. )</li>
<li>Virtualized Hosts ( OS may be dependent on simulated events for randomness. )</li>
</ul>
<p>( Given the exploding popularity of virtualization, this is an area worthy of research. Stay tuned. )</p>
<p><strong>Design of the Got Entropy Service</strong></p>
<p>Many RNGs (such as the one included in Linux, as well as OpenSSL&#8217;s) allow the addition of entropy from outside sources. So I started looking to Entropy sources I could use to bolster the RNGs on my virtual hosts (and other uses&#8230;). While I was looking into this, it occurred to me that I had an unused TV tuner card, a PVR-350.</p>
<p>When a TV is tuned to a channel with no local station, the &#8217;snow&#8217; on the screen is RF noise (the same as the static between stations on AM radios). But, for reasons beyond our scope, you never use a direct physical observation as the RNG. You have to &#8216;de-skew and whiten&#8217; the data prior to sampling it. Here is the process that I use:</p>
<ol>
<li>Collect about 3 minutes of video ( about 130 MB data ).</li>
<li>Using a random key and IV, encrypt the data ( using openssl &amp; AES-128-CBC ).</li>
<li>Discard the first 32k of the file.</li>
<li>Use each of the following 32k blocks as samples.</li>
<li>Compress each sample with SHA-256.</li>
<li>Discard the last block.</li>
</ol>
<ul>
<li>Steps 2 and 3 remove any patterns, such as MPEG file formatting, from the data.</li>
<li>Steps 4 and 5 generate a 32-byte random value ( 1024 to 1 compression in the hash ).</li>
</ul>
<p><strong>Check it out at <a href="http://gotentropy.artofinfosec.com" >http://gotentropy.artofinfosec.com</a></strong></p>
<p><strong>Can an Attacker Broadcast a Signal to Undermine This?</strong></p>
<p>Such an attacker could not remove RF noise from the received signal. Our eyes and brains are good at filtering out the noise in the TV video, but there is a lot of it. Part of the noise comes from the atmospheric background RF, but there are also flaws (noise) in the tuner&#8217;s radio and analog-to-digital capture circuitry.</p>
<p>I think this is a pretty strong RNG, and I have provided an interface for pulling just the values.</p>
<p>Also, I have written a script ( <a href="http://gotentropy.artofinfosec.com/getEntropy.sh" >getEntropy.sh</a> ) that will pull Entropy from the service and seed it into /dev/random on Linux.</p>
<p><strong>Results from ENT</strong></p>
<p>Here are results, from a sample run of the Got Entropy, analyzed by  <a href="http://www.fourmilab.ch/random/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.fourmilab.ch/random/');">ENT</a> ( A Pseudorandom Number Sequence Test Program provided by John Walker of www.fourmilab.ch - Thanks, John! ).</p>
<ul>
<li>Entropy = 7.999987 bits per byte</li>
<li>Optimum compression would reduce the size of this 13366112 byte file by 0 percent.</li>
<li>Chi square distribution for 13366112 samples is 233.85, and randomly would exceed this value 82.48 percent of the time.</li>
<li>Arithmetic mean value of data bytes is 127.4767 (127.5 = random).</li>
<li>Monte Carlo value for Pi is 3.143054786 (error = 0.05 percent).</li>
<li>Serial correlation coefficient is -0.000078 (totally uncorrelated = 0.0).</li>
</ul>
<p><strong>Resources for the Curious&#8230;</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Pseudorandom_number_generator" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://en.wikipedia.org/wiki/Pseudorandom_number_generator');">Wikipedia - Pseudo-random Number Generator</a></li>
<li><a href="http://en.wikipedia.org/wiki/Hardware_random_number_generator" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://en.wikipedia.org/wiki/Hardware_random_number_generator');">Wikipedia - Hardware Random Number Generator</a></li>
<li><a href="http://csrc.nist.gov/groups/ST/toolkit/rng/index.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://csrc.nist.gov/groups/ST/toolkit/rng/index.html');">NIST - Random Numbers Page</a></li>
<li><a href="http://community.webreview.com/windows/184409807" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://community.webreview.com/windows/184409807');">Netscape RNG Attack</a></li>
<li><a href="http://www.vanheusden.com/ved/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.vanheusden.com/ved/');">van Heusden Video Rand</a></li>
</ul>
<p>Cheers, Erik</p>
<p><a href="http://artofinfosec.com" >Art of Information Security</a> would <a href="http://artofinfosec.com/feedback/" >love your feedback</a> !</p>
<p><a href="http://artofinfosec.com/?p=53" >Got Entropy ?</a></p>
<img src="http://feeds.feedburner.com/~r/artofinfosec/~4/262366868" height="1" width="1"/>]]></content:encoded>
      <pubDate>Tue, 01 Apr 2008 22:55:47 +0000</pubDate>
      <category domain="http://securityratty.com/tag/entropy">entropy</category>
      <category domain="http://securityratty.com/tag/random">random</category>
      <category domain="http://securityratty.com/tag/32-byte random">32-byte random</category>
      <category domain="http://securityratty.com/tag/byte">byte</category>
      <category domain="http://securityratty.com/tag/hardware random">hardware random</category>
      <category domain="http://securityratty.com/tag/entropy sources">entropy sources</category>
      <category domain="http://securityratty.com/tag/sequence">sequence</category>
      <category domain="http://securityratty.com/tag/random sequence">random sequence</category>
      <category domain="http://securityratty.com/tag/pull entropy">pull entropy</category>
      <source url="http://feeds.feedburner.com/~r/artofinfosec/~3/262366868/">Got Entropy ?</source>
    </item>
    <item>
      <title><![CDATA["Crawling" Toward SDL]]></title>
      <link>http://securityratty.com/article/6340a9b5d612b714ea8fad65d3999ed0</link>
      <guid>http://securityratty.com/article/6340a9b5d612b714ea8fad65d3999ed0</guid>
      <description><![CDATA[Hey everyone, Jeremy Dallman here

One of the phrases I often hear during vision and strategy planning meetings at Microsoft is &quot;What is the crawl, walk, run?&quot; We use this phrase to differentiate the...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Hey everyone, Jeremy Dallman here. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>One of the phrases I often hear during vision and strategy planning meetings at Microsoft is "What is the crawl, walk, run?" We use this phrase to differentiate the initial activities that will get us quickly moving toward our larger goals and then supplement them with other activities that may require longer preparation or planning. As I help non-Microsoft companies implement SDL into their development lifecycles, this "crawl" phase toward full adoption of SDL is very important. Usually some person in an organization picks up on the principles of SDL and is ready to roll them out immediately. However, that person usually is faced with competing interests that complicate full adoption: the team is mid-stream in development, short on budget, or management wants to see clear evidence before investing in the changes to support full SDL adoption. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Since we usually focus on how to roll out the full Lifecycle, I want to take a shot at defining what it means to start “crawling” toward SDL. One very important note before I start. What I describe below is not Microsoft’s SDL process. It matches some of the tools and principles, but does not encompass the holistic application security solution provided by SDL. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>In my mind, to start crawling toward SDL, you need to execute on some of the core principles. They obviously need to be low-cost and effective. So, I want to summarize these into three components. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Detailed awareness of your architecture and its </FONT><A href="http://msdn2.microsoft.com/en-us/magazine/cc163882.aspx" mce_href="http://msdn2.microsoft.com/en-us/magazine/cc163882.aspx"><FONT size=3 face=Calibri>attack surface</FONT></A><FONT size=3><FONT face=Calibri>.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Tools that will perform security analysis on your application.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Results that show how the analysis resulted in improved security.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>The good news is that you can attain these components with tools that are already available. The one consistent minimum requirement is that your code compiles/builds within Visual Studio 2005 SP1. The SP1 piece of this is important because some of the important defenses I discuss below were first made available in that version. Let’s look at some of the tools you can use to get “crawling” toward SDL today:<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 14pt; COLOR: #365f91; mso-themecolor: accent1; mso-themeshade: 191"><FONT face=Calibri>Detailed awareness of your architecture and its attack surface<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><A href="http://msdn.microsoft.com/msdnmag/issues/06/11/ThreatModeling/default.aspx" mce_href="http://msdn.microsoft.com/msdnmag/issues/06/11/ThreatModeling/default.aspx"><FONT color=#0000ff size=3 face=Calibri>Threat Modeling</FONT></A><o:p></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Even if you are past the design phase, assign someone to do a retrospective model (perhaps as part of a pre-release review). This will likely give you a better understanding of your overall architecture and uncover holes in places you may have inadvertently overlooked. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>&nbsp;<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 14pt; COLOR: #365f91; mso-themecolor: accent1; mso-themeshade: 191"><FONT face=Calibri>Tools that will perform security analysis on your application<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>This is probably one of the most often discussed topics around SDL, so I’ll spend some time providing more detail. Let’s break this down into how it impacts differing parts of your team or organization: developers, testers, and operation. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Developers</B></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>You should start by strengthening your compiler defenses. Depending on whether you are writing native or managed code, these will differ. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>For C and C++ code:<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><I style="mso-bidi-font-style: normal"><U><FONT size=3><FONT face=Calibri>Strengthen your compiler defenses<o:p></o:p></FONT></FONT></U></I></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Use the latest compiler and linker because important defenses are added by the tools<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>If using Visual C++, <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>use Visual Studio 2005 SP1 or later<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Compile with appropriate compiler flags<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Compile clean at the highest possible warning level<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Compile with –GS to detect stack-based buffer overruns<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Link with appropriate linker flags: /NXCompat to get NX defenses, /DynamicBase to get ASLR,<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>and /SafeSEH to get exception handler protections<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><I style="mso-bidi-font-style: normal"><U><FONT size=3><FONT face=Calibri>Do not use banned APIs in new code<o:p></o:p></FONT></FONT></U></I></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo4" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Use #include “banned.h” header file to find banned C/C++ functions in your code quickly. This header file is included in the companion disk in the </FONT><A href="http://www.microsoft.com/mspress/books/8753.aspx" mce_href="http://www.microsoft.com/mspress/books/8753.aspx"><FONT size=3 face=Calibri>Security Development Lifecycle book</FONT></A><FONT size=3><FONT face=Calibri>.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo4" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Compile regularly with /W4 and fix all C4996 (banned C Runtime function) warnings<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>For all Languages:<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><I style="mso-bidi-font-style: normal"><U><FONT size=3><FONT face=Calibri>Strengthen your compiler defenses<o:p></o:p></FONT></FONT></U></I></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Use the latest compiler, linker and libraries because defenses are added by the tools and code<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l2 level2 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore"><FONT size=3>o</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>If using C#, use&nbsp; C# v2.0 or later and if using VB.Net use 8.0 or later<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Use .NET Framework 2.0 or later<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Do not use weak crypto in new code<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; mso-list: l2 level2 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore"><FONT size=3>o</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Use only AES, RSA and SHA-256 (or better)<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Prevent XSS vulnerabilities by using </FONT><A href="http://msdn2.microsoft.com/en-us/security/aa973814.aspx" mce_href="http://msdn2.microsoft.com/en-us/security/aa973814.aspx"><FONT color=#0000ff size=3 face=Calibri>filtering and escaping</FONT></A><FONT size=3><FONT face=Calibri> libraries around all Web output<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3 face=Calibri>Secure your SQL script by only using </FONT><A href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx"><FONT color=#0000ff size=3 face=Calibri>prepared SQL statements</FONT></A><FONT size=3><FONT face=Calibri> - no string concatenation or string replacement<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><I style="mso-bidi-font-style: normal"><U><FONT size=3><FONT face=Calibri>Run these tools habitually<o:p></o:p></FONT></FONT></U></I></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l6 level1 lfo1" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><A href="http://msdn2.microsoft.com/en-us/library/ms933794.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms933794.aspx"><FONT color=#0000ff size=3 face=Calibri>PREfast</FONT></A><FONT size=3><FONT face=Calibri> (in Visual Studio 2005, use the /analyze compiler option) – a static analysis tool that identifies defects in C/C++ programs and enables you to perform quick desktop error detection on small code bases<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol"><FONT size=3>·</FONT></SPAN><SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><A href="http://msdn2.microsoft.com/en-us/library/bb429476(vs.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb429476(vs.80).aspx"><FONT color=#0000ff size=3 face=Calibri>FxCop</FONT></A><FONT size=3><FONT face=Calibri> – an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in" class=MsoListParagraph><SPAN style="FONT-FAMILY: Symbol"><FONT size=3>·</FONT></SPAN><SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><A href="http://msdn2.microsoft.com/en-us/library/aa480483.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa480483.aspx"><FONT color=#0000ff size=3 face=Calibri>Application Verifier</FONT></A><FONT size=3><FONT face=Calibri> (AppVerif) – detect and help debug memory corruptions, critical security vulnerabilities, and limited user account privilege issues.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><FONT size=3><FONT face=Calibri>Testers</FONT></FONT></B></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3 face=Calibri>James Whittaker has covered </FONT><A href="http://blogs.msdn.com/sdl/archive/2007/05/24/testing-in-the-sdl.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2007/05/24/testing-in-the-sdl.aspx"><FONT size=3 face=Calibri>testing in the SDL</FONT></A><FONT size=3 face=Calibri> on this blog in the past. In a “crawl” scenario, you need to keep it simple while maximizing the value of output. I would recommend focusing on fuzz testing. This is likely something you will need to invest some time creating.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Scott Lambert’s article on </FONT><A href="http://blogs.msdn.com/sdl/archive/2007/09/20/fuzz-testing-at-microsoft-and-the-triage-process.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2007/09/20/fuzz-testing-at-microsoft-and-the-triage-process.aspx"><FONT color=#0000ff size=3 face=Calibri>Fuzz Testing at Microsoft and the Triage Process</FONT></A><FONT size=3><FONT face=Calibri> provides some good guidance on how to think through what type(s) of fuzzing to exercise against your application. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3 face=Calibri>If you choose to expand beyond fuzz testing, I would point you back to James’ article on the broader topic of </FONT><A href="http://blogs.msdn.com/sdl/archive/2007/05/24/testing-in-the-sdl.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2007/05/24/testing-in-the-sdl.aspx"><FONT size=3 face=Calibri>Testing in SDL</FONT></A><FONT size=3><FONT face=Calibri>. You may come to the conclusion that expanded security testing<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>may come later in your “walk” or “run” phases, but I would take some time to think through testing even while “crawling” to ensure you are getting broad enough coverage for your application. James’ article highlights the three-pronged approach to security testing we use at Microsoft. You should use these three approaches to ensure your own fuzz testing is comprehensive. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo6" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Attacks against the application’s environment.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo6" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Direct attacks against the application itself.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo6" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Indirect attacks against the application’s functionality.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN style="BACKGROUND: silver; mso-highlight: silver"><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 14pt; COLOR: #365f91; mso-themecolor: accent1; mso-themeshade: 191"><FONT face=Calibri>Results that show how the analysis resulted in improved security<o:p></o:p></FONT></SPAN></B></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Response planning</B></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3 face=Calibri>Protecting your customers is the entire reason for focusing energy on application security.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If there are holes in your code that you don’t uncover, someone else will. It is absolutely critical that you are prepared to respond rapidly and protect your customers. It is equally important that you construct your<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>response plan to serve as a front-line barometer for detecting the resilience of your security design<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>and what pieces of your applications security should be proactively bolstered to<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>address externally reported vulnerabilities. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>The knowledge you harvest from these security incidents (typically through root cause analysis) is the primary way to improve your code and security tooling for the future.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Do everything you can to learn lessons from the vulnerabilities others find. If you don’t have a response plan in place, you need to get one in place as soon as possible. If you don’t know where to start, take a look at how our own </FONT><A href="http://www.microsoft.com/security/msrc/incident_response.mspx" mce_href="http://www.microsoft.com/security/msrc/incident_response.mspx"><FONT size=3 face=Calibri>Microsoft Security Response Center</FONT></A><FONT size=3 face=Calibri> does it and fit to your scale or pick up the </FONT><A href="http://www.microsoft.com/mspress/books/8753.aspx" mce_href="http://www.microsoft.com/mspress/books/8753.aspx"><FONT size=3 face=Calibri>Security Development Lifecycle book</FONT></A><FONT size=3><FONT face=Calibri> and dig into the four-step process outlined.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt 0.25in" class=MsoNormal><FONT size=3><FONT face=Calibri>The four steps of the emergency response process:<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo7" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Watch<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo7" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Alert and Mobilize<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo7" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Assess and Stabilize<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l5 level1 lfo7" class=MsoListParagraph><SPAN style="mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri"><SPAN style="mso-list: Ignore"><FONT size=3 face=Calibri>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri>Resolve<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Bugs, Bugs, Bugs</B></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>Gathering evidence that clearly shows your work has improved the security of your application is always a challenge. Trying to keep it lightweight adds to that challenge. The most effective way to create traceable and practical evidence without a lot of overhead is detailed management of security issues in your bug database.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The key here is that your bug database is configurable and able to be queried in a variety of ways to pull out this data. From the time you set out to implement this plan, be strict in tracking every discovery from threat modeling, the mitigations to those threats, and every bug you expose in tool analysis. This library of security bugs will give you an easy way to go back and gather evidence that shows the quantity of issues you discovered, the mitigations you used, and the impact the changes had on your application.<o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>I have provided a fairly detailed view of these components. As I indicated, many of these defenses are available for you in Visual Studio 2005 SP1 or various linked resources above. If you are unsure whether you are taking advantage of all available defenses in your development tools, take the time to check. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>It is my hope that some of you can use this scaled back entry into the principles of SDL to get moving toward improved security assurance. In the non-Microsoft SDL engagements I have been involved in, we have seen these steps&nbsp;effectively establish a baseline architectural understanding of your application security and identify critical weaknesses while providing solid evidence to support the decision to “run” forward into full SDL adoption. <o:p></o:p></FONT></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3><FONT face=Calibri>[I want to thank Michael Howard for providing some of the key data for the Developer pieces in&nbsp;this article.]<o:p></o:p></FONT></FONT></P><img src="http://blogs.msdn.com/aggbug.aspx?PostID=8081069" width="1" height="1">]]></content:encoded>
      <pubDate>Thu, 06 Mar 2008 19:13:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/sdl">sdl</category>
      <category domain="http://securityratty.com/tag/security">security</category>
      <category domain="http://securityratty.com/tag/perform security analysis">perform security analysis</category>
      <category domain="http://securityratty.com/tag/application security">application security</category>
      <category domain="http://securityratty.com/tag/application">application</category>
      <category domain="http://securityratty.com/tag/applications security">applications security</category>
      <category domain="http://securityratty.com/tag/security issues">security issues</category>
      <category domain="http://securityratty.com/tag/issues">issues</category>
      <category domain="http://securityratty.com/tag/non-microsoft sdl engagements">non-microsoft sdl engagements</category>
      <source url="http://blogs.msdn.com/sdl/archive/2008/03/06/crawling-toward-sdl.aspx">"Crawling" Toward SDL</source>
    </item>
    <item>
      <title><![CDATA[What Does SHA1 is Broken Mean?]]></title>
      <link>http://securityratty.com/article/fa9144afb671eb0d6bf7ef80a736718b</link>
      <guid>http://securityratty.com/article/fa9144afb671eb0d6bf7ef80a736718b</guid>
      <description><![CDATA[For those of you Slashdot readers out there, you may have heard by now that SHA1 is broken. Recently I did some security videos for Microsoft, and decided that SHA1 was the best hash function for the...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">For those of you Slashdot readers out there, you may have heard by now that &#8216;SHA1 is broken&#8217;.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Recently I did some security videos for Microsoft, and decided that SHA1 was the best hash function for the example (modifying an existing application to store hashed passwords).<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">The videos I did were part of the &#8220;How Do I&#8221; series, and not exactly the place to explain why it was appropriate to use SHA1.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>But for those of you looking to understand the why behind the example, I&#8217;ll take a few minutes to explain it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: Arial">What exactly is SHA1?<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">SHA1 is a hashing algorithm, also known as a one way function.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>A one way function is where given any value of x, it is easy to find f(x), but given f(x) it is unrealistic to find x.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>One way functions allow us to take a &#8216;fingerprint&#8217; of data without storing the data itself. In a password scheme, instead of storing a user&#8217;s password (x) we instead store a hash of the password (f(x)).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Later when the user wants to login, he again supplies a password which we hash and compare against our stored value.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">It&#8217;s also useful for ensuring the integrity of data.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>When a message is sent over an unsecured channel, a hash of the message can also be used to check the message once it reaches its destination.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If the message does not match the hash, then we assume it was modified in transit.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: Arial">Designed Strength of SHA1<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">When we hash data, the range of values for x is infinite.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The hash on the other hand is a fixed size.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Therefore, for each value in the range of our hash, there are an infinite number of possible values for x.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">This range of possible values determines the odds of guessing a value x to match a known value f(x).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If the size of the hash value was 2<SUP>1</SUP>, there would be a 50/50 chance that the valued guessed would match our known f(x).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>That&#8217;s why SHA1 utilizes a very large hash size of 2<SPAN class=Style1Char>160</SPAN>.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>To put that in perspective, the Earth is composed of 2<SPAN class=Style1Char>170</SPAN> atoms.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>It&#8217;s computationally unrealistic that anyone would be able to beat those one in 2<SPAN class=Style1Char>160</SPAN> odds to find a value x which matches our known value f(x) (with today&#8217;s technology).<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: Arial">The Birthday Paradox<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">Some of you may be asking yourself, &#8220;but I read on Wikipedia that SHA1 has a strength of 2<SPAN class=Style1Char>80</SPAN>?&#8221;<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This is true, but to understand why, we will first look at the birthday paradox.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">How many people must be in a room before the odds are even that one of them shares your birthday?<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">How many people must be in a room before the odds are even that two of them share the same birthday?<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">In the first question, we are looking to match a specific value, while in the second we were just looking for any 2 matches.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The answers are 253 and 23.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The reason for the difference is that between the 23 people, there are 253 unique combinations.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>In one way functions, this is the difference between finding what we call a pre-image value versus a collision.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">The reason we say the strength of SHA1 is 2<SPAN class=Style1Char>80</SPAN>, is because we are talking about finding collisions (any two values for x with the same f(x)).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>When we are hashing passwords, we are asking the person logging in to match a specific f(x), and the strength of SHA1 in that situation would be 2<SPAN class=Style1Char>160</SPAN>.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: Arial">The Current Strength of SHA1<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">The analysis of SHA1 shows that collisions were found in 2<SPAN class=Style1Char>63</SPAN>.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>It&#8217;s now becoming computationally feasible to find two values of x that match an f(x).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>It&#8217;s still short of being probable that those two matches found would allow an attacker to compromise an encryption system, but the worry is that SHA1&#8217;s strength will continue to decline.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">Until the strength of SHA1 drops to 2<SPAN class=Style1Char>40</SPAN>, it is still a valid way to protect against pre-image attacks.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: Arial">Why Did I Choose SHA1?<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">In addition to SHA1 being secure in the example, there were a couple of other reasons I choose to use it instead of something like SHA256 (2<SPAN class=Style1Char>256</SPAN>).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>The first reason was that in the example, I was showing how to modify an existing application, by simply changing the value in the password field from a password to the base64 string representation of the hash, which is 28 characters in length (for SHA256, it would be 44 characters).<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If the database allowed passwords that size, then it&#8217;s trivial to add support for hashing.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">The other reason is that there are far easier ways of attacking a password field than targeting SHA1.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>An offline dictionary attack against the users&#8217; passwords is several orders of magnitude easier.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>SHA1 protects the hash against brute force attacks.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>It does nothing to protect a user who chooses a poor password.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">A system is only as strong as its weakest link.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-FAMILY: Arial">-Eric Marvets<o:p></o:p></SPAN></P><img src ="http://marvets.com/blog/aggbug/5592.aspx" width = "1" height = "1" />]]></content:encoded>
      <pubDate>Wed, 12 Dec 2007 04:35:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/sha1">sha1</category>
      <category domain="http://securityratty.com/tag/choose sha1">choose sha1</category>
      <category domain="http://securityratty.com/tag/sha1 protects">sha1 protects</category>
      <category domain="http://securityratty.com/tag/hash data">hash data</category>
      <category domain="http://securityratty.com/tag/data">data</category>
      <category domain="http://securityratty.com/tag/sha1 drops">sha1 drops</category>
      <category domain="http://securityratty.com/tag/hash function">hash function</category>
      <category domain="http://securityratty.com/tag/hash">hash</category>
      <category domain="http://securityratty.com/tag/function">function</category>
      <source url="http://marvets.com/blog/archive/2007/12/12/5592.aspx">What Does SHA1 is Broken Mean?</source>
    </item>
  </channel>
</rss>
