<?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: result]]></title>
    <link>http://securityratty.com/tag/result</link>
    <description></description>
    <pubDate>Wed, 29 Oct 2008 16:49:54 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Anti-Debugging Series - Part I]]></title>
      <link>http://securityratty.com/article/5dc5d012cfad6c070272eeb8f4c0dc2b</link>
      <guid>http://securityratty.com/article/5dc5d012cfad6c070272eeb8f4c0dc2b</guid>
      <description><![CDATA[For those that dont know, anti-debugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target process. Typically this...]]></description>
      <content:encoded><![CDATA[<p>For those that don&#8217;t know, anti-debugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target process. Typically this is achieved by detecting minute differences in memory, operating system, process information, latency, etc. that occur when a process is started in or attached to by a debugger compared to when it is not. Most research into anti-debugging has been conducted from the vantage point of a reverse engineer attempting to bypass the techniques that have been implemented. Limited data has been presented that demonstrates anti-debugging methods in a high level language that the average developer can understand. It is with this in mind that I hope to begin a series of posts that present some of the methods of anti-debugging in a clear, concise, and well documented fashion. The end goal of this series is to arm developers with the techniques and knowledge that will allow them to add a layer of protection to their software while simultaneous educating reverse engineers in some of the anti-debugging methods used by malware authors today.</p>
<p>Before we delve into the intricacies of individual methods of anti-debugging let&#8217;s use this post to define the classes of anti-debugging that we will be discussing. While other classes may exist, the definition of these classes is an attempt to include the majority of anti-debugging methods in use today. There is some overlap between classifications and we may have left out some methods due to limited exposure or effectiveness.</p>
<p><strong>API Based Anti-Debugging</strong><br />
API based anti-debugging is the most straightforward and possibly the easiest to understand for a typical developer. Using both documented and undocumented API calls, these methods query process and system information to determine the existence or operation of a debugger. From single line calls such as IsDebuggerPresent() and CheckRemoteDebugger() to slightly more complex methods including debugger detaching and CloseHandle() checks. These methods are generally trivial to add to an existing code base and many can even be implemented in as few as two or three lines.</p>
<p><strong>Exception Based Anti-Debugging</strong><br />
Exception based anti-debugging is slightly different than your basic API based techniques. Many times when a debugger is attached to a process, exceptions are trapped and handled by the debugger without regard to passing the exception back to the application for continued execution. Occasionally these exceptions can even crash or terminate a process when run under a debugger and be handled gracefully when running clean. It is these discrepancies that makes exception based anti-debugging techniques possible.</p>
<p><strong>Process and Thread Block Anti-Debugging</strong><br />
Some of the API based anti-debugging methods use published functions to query information from within the process and thread blocks for our running code. Many API based detections can be subverted within a debugger by hooking the API call and returning values that indicate a clean process. One way around this subversion is to directly query the process and thread blocks, bypassing the API calls. Direct analysis of the process and thread blocks, while more complex, can lead to a more accurate and high assurance result.</p>
<p><strong>Modified Code Anti-Debugging</strong><br />
One of the methods that a debugger uses to signal a breakpoint is to insert a break byte into the running code at the location that it wishes to stop execution. The process execution breaks when this value is seen, giving control to the debugger. When the program is resumed, the breakpoint value is removed and replaced with the original byte, the execution backed up one byte, and the program is resumed. Detection of software based breakpoints can be achieved by analyzing the process for modifications from the expected norm.</p>
<p><strong>Hardware and Register Based Anti-Debugging</strong><br />
A second way that a debugger can break the execution of a process is by using a hardware breakpoint. A hardware breakpoint relies upon CPU registers to store the pertinent information and to detect when the target break addresses are seen on the bus. A break interrupt is triggered at the appropriate time based on these register values. Reading or modifying the hardware can allow for the detection of a debugger.</p>
<p><strong>Timing and Latency Anti-Debugging</strong><br />
Finally timing and latency can be used as an effective anti-debugging method. When executing a program within a debugger, specifically when single stepping, a much larger latency occurs between execution of instructions. This latency can be detected and compared against a reasonable threshold to detect the existence of a debugger attached to our process.</p>
<p>Each of the classes of anti-debugging outlined above has merit when used individually to protect a process. While none of them can be assured to ever protect a program from a determined reverse engineer or debugger, implementation of these techniques (or many of them if appropriate) can sufficiently slow down the debugging process and hopefully make the attacker spend his time on other, easier, ventures. In the remainder of this series on anti-debugging we will review in depth some of the more interesting methods of each of the above classes. So bring along your debugger and your development environment and let the games begin.</p>
]]></content:encoded>
      <pubDate>Tue, 02 Dec 2008 17:56:25 +0000</pubDate>
      <category domain="http://securityratty.com/tag/process execution breaks">process execution breaks</category>
      <category domain="http://securityratty.com/tag/execution">execution</category>
      <category domain="http://securityratty.com/tag/process">process</category>
      <category domain="http://securityratty.com/tag/methods query process">methods query process</category>
      <category domain="http://securityratty.com/tag/hardware breakpoint">hardware breakpoint</category>
      <category domain="http://securityratty.com/tag/hardware">hardware</category>
      <category domain="http://securityratty.com/tag/process information">process information</category>
      <category domain="http://securityratty.com/tag/target process">target process</category>
      <category domain="http://securityratty.com/tag/methods">methods</category>
      <source url="http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/">Anti-Debugging Series - Part I</source>
    </item>
    <item>
      <title><![CDATA[Stampede Death at Wal-Mart]]></title>
      <link>http://securityratty.com/article/a5436ad4dbabae1cfd63a3bda7bfbafd</link>
      <guid>http://securityratty.com/article/a5436ad4dbabae1cfd63a3bda7bfbafd</guid>
      <description><![CDATA[The death of a Wal-Mart employee on Black Friday in New York should never have been allowed to happen

The Police are said to be reviewing tapes to see if they can identify who was responsible for...]]></description>
      <content:encoded><![CDATA[The death of a Wal-Mart employee on Black Friday in New York should never have been allowed to happen.<br /><span id="fullpost"><br />The Police are said to be reviewing tapes to see if they can identify who was responsible for trampling the poor man to death.  What will that achieve?  Obviously it was not done on purpose.  The findings are bound to result in an "accidental death" determination. <br /></span><br />Getting back to; who is responsible?  I think that is quite clear.  Wal-Mart has to accept responsibility.  UNLESS...they really did hire an outside security company and the employees of that company did such a poor job organizing that mob of "door busters", that they lost control of the situation.<br /><br />One thing is a given.  The family of the employee who lost his life is bound to bring a civil law suit against Wal-Mart.  If I were them, the first thing I would look to find out would be who(if anyone)was providing security on Thanksgiving night outside of the front door?  <br /><br />Unfortunately, many clients do not take the function of security very seriously and they delegate the responsibility to those with no security training or experience.  We have consulted for clients at arenas and found that ordinary ushers will be given a fluorescent vest or jacket with "SECURITY" written on the back and asked to provide security.  This is a libility claim waiting to be filed.<br /><br />If Wal-Mart did in fact outsource their security to an outside company, was the company allowed to provide an adequate number of officers to ensure that shoppers lined up in an orderly fashion?  One security officer to a couple of hundred people is another liability suit waiting to be filed.<br /><br />Next, they should be looking at the training that the security officers (Wal-Mart better hope that shelve stockers were not given the task)receieved.  Because it was Thanksgiving night, there is the possibility that the company couldn't get anybody else to work and used untrained and inexperienced personnel.  If that turns out to be the case, hopefully the company was legal and had adequate insurance coverage.<br /><br />Whatever happens regarding a civil law suit, one thing will remain unchanged.  A man lost his life in an incident that should have been prevented.  It is obvious that not everything was done to ensure the safety of the shoppers who traditonally lined up to get the best bargains when the store opened on "Black Friday".<br /><br />Whether it was Wal-Mart or the security company who may have been hired to prevent this very incident from happening - somebody failed to do their job. Whichever one it was, they should step up to the plate and apologize to the grieving family for letting them down.<div class="blogger-post-footer">Visit Sexton Executive Security at www.sextonsecurity.com</div>]]></content:encoded>
      <pubDate>Mon, 01 Dec 2008 01:12:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/provide">provide</category>
      <category domain="http://securityratty.com/tag/provide security">provide security</category>
      <category domain="http://securityratty.com/tag/security">security</category>
      <category domain="http://securityratty.com/tag/security company">security company</category>
      <category domain="http://securityratty.com/tag/wal-mart">wal-mart</category>
      <category domain="http://securityratty.com/tag/company">company</category>
      <category domain="http://securityratty.com/tag/security officers">security officers</category>
      <category domain="http://securityratty.com/tag/wal-mart employee">wal-mart employee</category>
      <category domain="http://securityratty.com/tag/death">death</category>
      <source url="http://www.thebulletproofblog.com/2008/11/stampede-death-at-walmart.html">Stampede Death at Wal-Mart</source>
    </item>
    <item>
      <title><![CDATA[Chairman Tata Surprised by Tricky Terrorists]]></title>
      <link>http://securityratty.com/article/7b4520b092d5aedad18be187c5cd3069</link>
      <guid>http://securityratty.com/article/7b4520b092d5aedad18be187c5cd3069</guid>
      <description><![CDATA[Chairman Rata Tata, whose company owns the Taj hotel in Mumbai, gave a frank and honest interview to CNN. I would imagine that the Tata Group's PR people and General Counsel are scrambling at the...]]></description>
      <content:encoded><![CDATA[Chairman Rata Tata, whose company owns the Taj hotel in Mumbai, gave a frank and honest interview to CNN.  I would imagine that the Tata Group's PR people and General Counsel are scrambling at the moment trying to do as much damage control as possible. <br /><span id="fullpost"><br />The sad part of this unfolding story is the feeling one gets that the terrible loss of life at the hotel may have been prevented or at least mitigated had proper security measures been implemented and if the security that had been in place prior to the attack had not been removed.  <br /></span><br />One eye witness who stayed at the hotel a week before the terrorist assault spoke about metal detectors and baggage being checked.  The same witness then went on to say that those security measures had been removed within the last week, allowing people to enter without being checked.<br /><br />The most surprising news to surface must be the Chairman's comments regarding the terrible event. Unbelievably, he actually said; "They knew what they were doing and they did not go through the front.  All of our arrangements were on the front entrance".<br /><br />Who is Tata's security advisor, a kitchen worker?  Actually, he might have been better off if that were the case since the terrorists entered the hotel through the rear kitchen door.  ANNOUNCEMENT TO ALL CHAIRMEN AND CEO's; Terrorists are Tricky.  That is their job.  They are watching your businesses and will do the opposite to what you expect.  <br /><br />In the case of the TAJ HOTEL, you made it easy for them.  Did nobody in Mumbai ever stop to think that a bad person can go through the back door?  It is one thing for a cafe in a pedestrian area to be attacked as anyone can walk right by or walk through the front and open fire, but how can a major landmark that attracts Western vistors drop their security measures AFTER they have received terrorist alert warnings that the hotel may be the target of terrorsit attacks?  <br /><br />I don't know if it was the case with the Taj Hotel, but cutting corners where security is concerned is common place in corporate culture.  Security is often seen as a necessary evil and usually the first department to experience budgetary cutbacks.  It is very difficult to convince some clients that nothing happening is really a good thing and that by cutting out security may open the door to evil.<br /><br />This appears to have been the case with the Taj.  There is no doubt that the terrorists had conducted hundreds of hours of surveillance in and around Mumbai.  Was it a coincidence that the attack occurred the week after security measures had been removed?  What might have been the result if security had remained tight (if you could call watching the front entrance and disregarding the back as "tight security")?  Maybe the terrorists would have held back another month or two...maybe in that time they would have been detected...<br /><br />One thing is for certain, places like the Taj Hotel have to get serious about security.  Mr. Tata's claim that; "If I look at what we had...it could not have stopped what took place", must be replaced by more progressive, proactive thinking.  If the Tata Group had spent an adequate amount of funding on ensuring that a strict security policy was in force - if only for the period in question - then they might not now be facing a 5 Billion Rupee reconstruction bill.  Who knows how high the civil suits against the Taj will run when compensation and punitive costs are calculated.         <br /><br />Kudos though to Chairman Tata for at least recognizing that the Indian authorities may not be able to handle the situation on their own.  "These attacks underscore the need for Law Enforcement to seek outside expertise for training, equipment and strategic operations", he said.<br /><br />We agree Mr. Tata.  We also hope that you will recognize the need for the Tata Group to seek similar outside expertise to assist you with your security planning and training.<div class="blogger-post-footer">Visit Sexton Executive Security at www.sextonsecurity.com</div>]]></content:encoded>
      <pubDate>Sun, 30 Nov 2008 22:29:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/security measures">security measures</category>
      <category domain="http://securityratty.com/tag/proper security measures">proper security measures</category>
      <category domain="http://securityratty.com/tag/tata">tata</category>
      <category domain="http://securityratty.com/tag/security">security</category>
      <category domain="http://securityratty.com/tag/security advisor">security advisor</category>
      <category domain="http://securityratty.com/tag/chairman tata">chairman tata</category>
      <category domain="http://securityratty.com/tag/chairman rata tata">chairman rata tata</category>
      <category domain="http://securityratty.com/tag/taj">taj</category>
      <category domain="http://securityratty.com/tag/taj hotel">taj hotel</category>
      <source url="http://www.thebulletproofblog.com/2008/11/chairman-tata-surprised-by-tricky.html">Chairman Tata Surprised by Tricky Terrorists</source>
    </item>
    <item>
      <title><![CDATA[Mayhem in Mumbai]]></title>
      <link>http://securityratty.com/article/b7902ee86f589ca527ebb734d591a745</link>
      <guid>http://securityratty.com/article/b7902ee86f589ca527ebb734d591a745</guid>
      <description><![CDATA[The total number of casualties rise in the financial capital of India after terrorists attack multiple locations

The latest figures suggest that at least 100 people have been killed and as many as...]]></description>
      <content:encoded><![CDATA[The total number of casualties rise in the financial capital of India after terrorists attack multiple locations.<br /><span id="fullpost"><br />The latest figures suggest that at least 100 people have been killed and as many as 900 injured.  Radio and television reporters are saying that it has all the hallmarks of an Al-Qaeda attack.  Locations included a railway station, a cinema, the Taj Hotel, and another very popular restaurant. <br /></span><br />It appears as if the terrorists singled out Westerners as they are reported to have taken British and American tourists hostages and brought them up to the 18th floor of the hotel.  This evening the hotel is on fire and the fate of the hostages is still unknown.<br /><br />The good news for some, is that they were able to escape form the hotel in the confusion.  It appears that the terrorists could have numbered dozens of heavily armed men.  This is definitely not a random attack but a well planned and executed operation aimed at causing mass casualties amnd hitting India's financial markets in much the same way as Wall Street was attacked on 9/11.<br /><br />We do not hear that much about India's terrorist problems in the West but I was made aware of it when I was invited to India to speak on Security matters this time last year.  I have since that time made clients and potenital clients aware of the  security situation.  <br /><br />There has been much outsourcing to India and many U.S. businesses are sending personnel over there as a result.  Those who can afford to have their own professional security protectors should consider that option very carefully.  It could very well turn out being more of a necessity than a luxury in these dangerous times.<div class="blogger-post-footer">Visit Sexton Executive Security at www.sextonsecurity.com</div>]]></content:encoded>
      <pubDate>Thu, 27 Nov 2008 02:48:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/india">india</category>
      <category domain="http://securityratty.com/tag/potenital clients aware">potenital clients aware</category>
      <category domain="http://securityratty.com/tag/taj hotel">taj hotel</category>
      <category domain="http://securityratty.com/tag/hotel">hotel</category>
      <category domain="http://securityratty.com/tag/clients">clients</category>
      <category domain="http://securityratty.com/tag/hostages">hostages</category>
      <category domain="http://securityratty.com/tag/mass casualties amnd">mass casualties amnd</category>
      <category domain="http://securityratty.com/tag/american tourists hostages">american tourists hostages</category>
      <category domain="http://securityratty.com/tag/aware">aware</category>
      <source url="http://www.thebulletproofblog.com/2008/11/mayhem-in-mumbai.html">Mayhem in Mumbai</source>
    </item>
    <item>
      <title><![CDATA[America's Next Top Hash Function Begins]]></title>
      <link>http://securityratty.com/article/782d55dd167bb0c5193cd7724d7e2313</link>
      <guid>http://securityratty.com/article/782d55dd167bb0c5193cd7724d7e2313</guid>
      <description><![CDATA[You might not have realized it, but the next great battle of cryptography began this month. It's not a political battle over export laws or key escrow or NSA eavesdropping, but an academic battle over...]]></description>
      <content:encoded><![CDATA[<p>You might not have realized it, but the next great battle of cryptography began this month. It's not a political battle over export laws or key escrow or NSA eavesdropping, but an academic battle over who gets to be the creator of the next hash standard.</p>

<p>Hash functions are the most commonly used cryptographic primitive, and the most poorly understood. You can think of them as fingerprint functions: They take an arbitrary long data stream and return a fixed length, and effectively unique, string. The security comes from the fact that while it's easy to generate the fingerprint from a file, it's infeasible to go the other way and generate a file given a fingerprint. </p>

<p>Originally created to make digital signatures more efficient, hashes are now used to secure the very fundamentals of our information infrastructure: in password logins, secure web connections, encryption key management, virus and malware scanning, and almost every cryptographic protocol in current use. Without cryptographic hash functions, the internet would simply not work. At the same time, there isn't a good theory of hash functions. Unlike encryption algorithms, there are no secret keys involved; this makes it harder to mathematically define exactly what hash functions are.
</p>

<p>
The National Institute of Standards and Technology, NIST, is <a href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html">holding a competition</a> to replace the SHA family of hash functions. "SHA" stands for "Secure Hash Algorithm." It was developed by the NSA in 1993 to replace the commercial MD4 and MD5 algorithms, and has been updated several times since then. All the SHA algorithms are very similar, and have been <a href="http://www.schneier.com/blog/archives/2005/02/cryptanalysis_o.html">increasingly under attack</a>, so NIST <a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_1.html">wants to replace them</a>.</p>

<p>The competition is important because, unlike other technological standards, committee design &#151; balancing the interests of diverse constituents &#151; isn't conducive to good security. Security is best when it's designed by expert teams and then subjected to public review. And cryptography is best when it's chosen by competition.</p>

<p>In 1997, NIST held a <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard_process">competition</a> for a <a href="http://csrc.nist.gov/archive/aes/index.html">block cipher</a> to replace DES. Fifteen candidates and three-and-a-half years later, Rijndael became the new Advanced Encryption Standard &#151; AES. NIST is doing the same thing for what it's calling SHA-3 (not, for some unexplained reason, the Advanced Hash Standard or AHS).</p>

<p>The deadline was October 31, and NIST received 64 submissions. This isn't surprising &#151; I <a href="http://www.schneier.com/blog/archives/2008/10/the_skein_hash.html">predicted</a> 80 &#151; as most of the 15 AES submitters were professors, whose students at the time have become professors themselves, with their own students. (If NIST does a stream cipher competition in another ten years, they should expect about 256 submissions.) These submissions came from academia, from industry, and from hobbyists. <cite><a href="http://www.cio.com/article/461164/Amateurs_and_Pros_Vie_to_Build_New_Crypto_Standard">CIO magazine</a></cite> recently interviewed one of the submitters, who is 15. Twenty-eight submissions have been made <a href="http://ehash.iaik.tugraz.at/wiki/The_SHA-3_Zoo">public</a> by the submitters, and six of those have been broken.  </p>

<p>NIST is going through all the submissions right now, making sure they are complete and proper. Their goal is to publish all accepted submissions by the end of November, in advance of the <a href="http://csrc.nist.gov/groups/ST/hash/timeline.html">First Hash Function Candidate Conference</a>, to be held in Belgium right after the <a href="https://www.cosic.esat.kuleuven.be/fse2009/index.shtml">Fast Software Encryption workshop</a> in February.  </p>

<p>The group expects to quickly make a first cut of algorithms &#151; hopefully to about a dozen &#151; and give the community a year of cryptanalysis before making a second cut in 2010. After another year of cryptanalysis, NIST will choose a winner in 2011. Expect a final standard by 2012.</p>

<p>My advice for software developers is to let the process run its course. While it's tempting to use the new cool algorithms in your designs, it's far too soon to trust any of them. This process is likely to result in all sorts of new research results in hash function security, and some real cryptanalytic surprises.  Give the community a few years to figure out which ones are good and which aren't.</p>

<p>I've previously called this sort of thing a cryptographic demolition derby: The last one left standing wins. But that's only partially true. Certainly all the groups will spend the next few years trying to cryptanalyze each other, but in the end there will be a bunch of unbroken algorithms. NIST will select one based on performance and features.</p>

<p>NIST has stated that the goal of this process is not to choose the best standard but to choose a good standard. I think that's smart; in this process, the best is the enemy of the good. While there's no rush to choose a new standard &#151; the SHA-2 algorithms will remain secure for the foreseeable future &#151; we don't want to analyze the candidates forever.</p>

<p>Personally, I was part of a group of eight cryptographers that submitted <a href="http://www.schneier.com/skein.html">Skein</a> to the competition. A decade ago, writing <a href="http://www.schneier.com/twofish.html">Twofish</a> and participating in the AES process was the most fun I had ever had in cryptography. These next few years promise to be even more fun.</p>

<p>---</p>

<p><i>Bruce Schneier is chief security technology officer of BT. His new book is </i>Schneier on Security<i>.</i></p><br style="clear: both;"/>
  <img alt="" style="border: 0; height:1px; width:1px;" border="0" src="http://www.pheedo.com/img.phdo?i=3fb55453a3600c210940457d550e67ec" height="1" width="1"/>
<img src="http://www.pheedo.com/feeds/tracker.php?i=3fb55453a3600c210940457d550e67ec" style="display: none;" border="0" height="1" width="1" alt=""/><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=AfuoN"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=AfuoN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=1WcCn"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=1WcCn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=dcuSn"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=dcuSn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=6jt5N"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=6jt5N" border="0"></img></a>
 <a href="http://feeds.wired.com/~f/wired/politics/security?a=yYWDN"><img src="http://feeds.wired.com/~f/wired/politics/security?i=yYWDN" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=yrdIn"><img src="http://feeds.wired.com/~f/wired/politics/security?i=yrdIn" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=CF0Rn"><img src="http://feeds.wired.com/~f/wired/politics/security?i=CF0Rn" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=l83kN"><img src="http://feeds.wired.com/~f/wired/politics/security?i=l83kN" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/wired/politics/privacy/~4/459059854" height="1" width="1"/><img src="http://feeds.wired.com/~r/wired/politics/security/~4/459059855" height="1" width="1"/>]]></content:encoded>
      <pubDate>Wed, 19 Nov 2008 23:00:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/hash function">hash function</category>
      <category domain="http://securityratty.com/tag/sha">sha</category>
      <category domain="http://securityratty.com/tag/sha-3">sha-3</category>
      <category domain="http://securityratty.com/tag/algorithms">algorithms</category>
      <category domain="http://securityratty.com/tag/cool algorithms">cool algorithms</category>
      <category domain="http://securityratty.com/tag/sha family">sha family</category>
      <category domain="http://securityratty.com/tag/nist held">nist held</category>
      <category domain="http://securityratty.com/tag/unlike encryption algorithms">unlike encryption algorithms</category>
      <category domain="http://securityratty.com/tag/nist">nist</category>
      <source url="http://feeds.wired.com/~r/wired/politics/security/~3/459059855/securitymatters_1120">America's Next Top Hash Function Begins</source>
    </item>
    <item>
      <title><![CDATA[The Economics of Finding and Fixing Vulnerabilities in Distributed Systems ]]></title>
      <link>http://securityratty.com/article/8a34266a61546df04c75d0de7416a33d</link>
      <guid>http://securityratty.com/article/8a34266a61546df04c75d0de7416a33d</guid>
      <description><![CDATA[The Economics of Finding and Fixing Vulnerabilities in Distributed Systems
Quality of Protection Keynote
Alexandria, VA
October 27. 2008

Gunnar Peterson
Managing Principal, Arctec Group
Blog:...]]></description>
      <content:encoded><![CDATA[<div>The Economics of Finding and Fixing Vulnerabilities in Distributed Systems&#0160;</div><div><a href="http://qop-workshop.org/Program.htm">Quality of Protection Keynote</a></div><div>Alexandria, VA</div><div>October 27. 2008</div><br /><div>Gunnar Peterson</div><div>Managing Principal, Arctec Group</div><div>Blog: http://1raindrop.typepad.com</div><br /><div>When Andy Ozment asked me over the summer to do this talk at QoP, I knew back in August that the topic I wanted to address was security and economics. So to that end I would like to start by thanking all of our friends on Wall Street and here in Washington DC for providing such a rich tapestry of recent events that I can speak to.</div><br /><div>Like many people in this industry, my focus on security was fundamentally altered by Dan Geer&#39;s speech &quot;Risk Management is Where the Money Is&quot;[1], there are not many people who can call a ten year shot in the technology business, but Dan Geer did. The talk revolutionized the security industry. Since that speech, the security market, the vendors, consultants, and everyone else has realized that security is really about risk management.</div><br /><div>Of course, saying that you are managing risk and actually managing risk are two different things. Warren Buffett started off his 2007 shareholder letter [2] talking about financial institutions&#39; ability to deal with the subprime mess in the housing market saying, &quot;You don&#39;t know who is swimming naked until the tide goes out.&quot; In our world, we don&#39;t know whose systems are running naked, with no controls, until they are attacked. Of course, by then it is too late.</div><br /><div>So the security industry understands enough about risk management that the language of risk has permeated almost every product, presentation, and security project for the last ten years. However, a friend of mine who works at a bank recently attended a workshop on security metrics, and came away with the following observation - &quot;All these people are talking about risk, but they don&#39;t have any assets.&quot; You can&#39;t do risk management if you don&#39;t know your assets.</div><br /><div>Risk management requires that you know your assets, that on some level you understand the vulnerabilities surrounding your assets, the threats against those, and efficacy of the countermeasures you would like to use to separate the threat from the asset. But it starts with assets. Unfortunately, in the digital world these turn out to be devilishly hard to identify and value.</div><br /><div>Recent events have taught us again, that in the financial world, Warren Buffett has few peers as a risk manager. I would like to take the first two parts of this talk looking at his career as a way to understand risk management and what we can infer for our digital assets.</div><br /><div>Warren Buffett&#39;s evolution as an investor can be broken up into two parts. He began his career very much influenced by Ben Graham, who sought to buy &quot;cheap stocks&quot;, comparing the price of the stock to value of the company&#39;s assets, and placing many, diversified bets on companies whose share price was below the total assets. Note that the businesses may have been of unremarkable quality, but when the price was right Graham would buy in, wait for it to rise and then sell. This was the dawn of value investing.</div><br /><div>Buffett&#39;s later career departed from Graham&#39;s strict, statistical measures, where he sought to buy into companies that were selling at a fair price, but were also high quality businesses. We will examine high quality in Part 2 of this talk, but first we go to Part 1 which is asset value.</div><br /><div>Why does a talk on finding and fixing vulnerabilities start with valuing assets? The reason is that vulnerabilities are everywhere, we are literally marinating in them. Interesting vulnerabilities are attached to high value assets. In a world that quite literally presents us with too much information, we need screens to sift out what is worth paying attention to. &#0160;You can run your vulnerability assessment tool of choice on your system, and come back with hundreds or thousands of vulnerabilities, but which ones should you pay attention to and act on? The first part of answering this question is asset value.</div><br /><div>When Warren Buffett was 19 years old studying at the University of Nebraska, he read Ben Graham&#39;s book &quot;The Intelligent Investor&quot;, Buffett said he thought it was the best book on investing he has ever read and still feels that way today. In the Intelligent Investor Graham lays out the framework of value investing. Specifically, Graham talks about three concepts - Mr. Market, a stock is a piece of a business, and Margin of Safety.</div><br /><div>Mr. Market is a fictional, teaching device invented by Graham. You imagine that you have a somewhat manic depressive business partner called Mr. Market. Every day, Mr. Market comes into the office and offers you quotes on companies, some days he is in a good mood and the prices are high, other days he is gloomy and prices are low. The market is a quote machine, for quoting prices, not a value assessment machine. Your job is to wait for the right price, and you are free to take as many passes and be as patient as you would like, Mr. Market will just show up the next day and throw out a new price.&#0160;</div><br /><div>Graham used Mr. Market to teach us the separation between a price of a stock, and the value of a company. The second big concept from Intelligent Investor is that buying a stock is buying a small piece of the underlying business. You are not buying a roulette chip, or a number that fluctuates in the newspaper every day, rather you are buying a piece of the company&#39;s existing and future cash flow. What the stock market says General Electric is worth yesterday, today or tomorrow is separate from GE&#39;s actual ability to generate cash flow.</div><br /><div>The last big concept in &quot;The Intelligent Investor&quot; and the one seemingly most applicable to information security is the Margin of Safety. Graham&#39;s margin of safety involved calculating the intrinsic value of a business and then buying stock where the market cap of a company is less than its intrinsic value. So if a company has $100 million in assets and a market capitalization of $75 million, then an investor would get a 25% margin of safety. Ideally, Graham wanted to buy stocks that were selling for one half of their book value, i.e. with a 50% margin of safety. Graham said that buying stocks without a margin of safety, above their book value, speculation, not investing.</div><br /><div>So price is readily available, but how do we calculate intrinsic value so that we can ascertain the margin of safety? Graham used quantitative statistical measures, relying heavily on the company&#39;s book value, like its hard assets. What would it take for a competitor to reproduce the company&#39;s assets - its factories, distribution system, and so on. The difference between the book value of the assets and market cap is the margin of safety.</div><br /><div>What can we learn in information security from this quantitative approach? Where price and value are readily ascertainable we should build countermeasures and eliminate on vulnerabilities that give our assets a wide margin of safety. Since budgets are not unlimited we should prefer vulnerabilities that are cheap to find, cheap to fix.</div><br /><div>First to the asset question, information security budgets like all IT budgets are crufty, they are not a reflection of today&#39;s top issues and priorities so much as an accumulating snowball of decisions, legacy contracts, and solution attempts to yesteryear&#39;s problems. Today the normal Information Security budget is just a legacy artifact from bygone years when the network was the purported greatest vulnerability. If you were around in 1995, you remember the great gnashing of gears as the enterprises opened up their networks, connected their back ends to the Web and began to transact business in the giant virtual space.</div><br /><div>The security people huffed and puffed that it was dangerous but there was simply too much money to be made, so businesses went ahead. The security people would not go down without a fight and insisted on countermeasures. They got two - the network firewall and SSL. The firewall was used to separate the average Fortune 500s network of hundreds of thousands of machines, employees, consultants, and partners from the web at large. SSL was used to protect the network channel between the web server and the client browser. so the network firewall separated the network segments, and SSL in effect encrypted the last mile of many million complex transactions and computations.</div><br /><div>In 1995, this seemed like a good security architecture. When we built out these security architectures, the eCommerce market was derided as a toy. Amazon famously lost money for years - losing a little on every transaction but making it up in volume. When the market is nascent, a quaint security architecture offers cost effective protection. But what about 2008? Those cute little eCommerce buggers have grown they even make profits now - market caps measured in the tens of billions, accumulating large cash hordes, no debt, and the largest ones are in better financial shape than the financial services players that kicked sand in their face in the dotcom era.&#0160;</div><br /><div>And its not just eCommerce, the &quot;real&quot; economy Fortune 500 types are all connected as well. Directly and indirectly the Web is seeping into all businesses. Major changes from when the security architecture of the web was built out. But has the security architecture changed to reflect these new business realities? Not a bit of it!</div><br /><div>We can use the book value of the IT budget investments and the book value of the Information Security investments to see what kind of Margins of Safety Information Security groups are engineering.</div><br /><div>Let&#39;s look at some market data, Gary McGraw reviewed the numbers [2] in software security for 2007, breaking down software security sectors like tools and services. Here is a summary of his findings on software security tools:</div><br /><div>&quot;One of the most important developments in the software security market can be seen in the tools space which, combined, almost doubled to $150-180 million. Top of list are two major acquisitions that closed in 2007: Watchfire&#39;s purchase by IBM (somewhere in the range of $120-150 million on 2006 revenue of $26 million) and SPI Dynamics&#39;s purchase by HP (for around $100 million on 2006 revenue of $21.2 million).</div><br /><div>...</div><br /><div>The black box space was flat in 2007, with IBM/Watchfire checking in at $24.1 million and HP/SPI Dynamics earning $22.3 million. Smaller companies in the space, including Cenzic, Codenomicon, WhiteHat and the like had combined revenues around $12.5 million (a growth of 25%, though Cenzic grew 16% and WhiteHat 52%). Most of the growth &quot;hiccup&quot; in the black box market can be attributed to the serious challenges posed by any acquisition. So far 2008 looks to be back on track from a growth perspective in the black box testing space. The global reach that IBM and HP offer are already making a big difference.</div><br /><br /><div>On a more positive note, static analysis tools for code review grew at a healthy clip in 2007 into a $91.9 million dollar market. Fortify was up 83% to $29.2 million. Klocwork grew over 60% to $26 million. Coverity grew over 50% to $27.2 million. Ounce Labs tripled their revenue to $9.5 million.&quot;</div><br /><div>These are very nice growth numbers, what company doesn&#39;t want 83% growth? However, the let&#39;s look at the total picture and compare the software security countermeasures against other security mechanisms. Gary McGraw&#39;s estimate shows the software security space coming in at $150 Million total, yet we see a company like Checkpoint that won the network security war in 1995 with earnings of around $900 Million! One single network security vendor is 6 times bigger than the entire software security space, in what alternate universe does this make sense?</div><br /><div>This is where we begin to see that decisions in the People&#39;s Republic of Information Security have no real risk management thinking, they truly are swimming naked and hoping the tide doesn&#39;t go out.</div><br /><div>Let&#39;s look at network assets. Obviously Cisco is the biggest, they earned $39.5 Billion last year. Pretty stellar. So spending $900 Million (Checkpoint) to defined $39.5 Billion seems like a pretty good deal.</div><br /><div>Except, let&#39;s compare software security spending - last year Microsoft earned $60 Billion, SAP $16 billion, and Oracle $22 Billion. So that is about $98 Billion in just three vendors and you are going to &quot;defend&quot; that with allocating $150 Million worth of software security tools?</div><br /><div>On the network side we are buying $900 million of security countermeasures (Checkpoint firewalls) to protect $39.5 billion worth of Cisco gear, about 2.3% of the network investment goes to security.</div><br /><div>On the software side, we are buying $150 million of security countermeasures (like static analysis and black box scanners) to protect $98 billion of software (you know the stuff that runs the whole business), roughly coming to about 0.2% of the software budget goes to security.</div><br /><div>This is very disturbing. From a prioritization standpoint The People&#39;s Republic of Information Security is misaligned by an order of magnitude at least. Next time you read about a data breach, or see an auditor&#39;s report with thousands of findings you won&#39;t have to wonder how it happened. It happened because Information Security doesn&#39;t have its eye on the ball, it invests in network security not because those controls have greater efficacy (the whole point of networks is they are dumb), no, they invest in network firewalls because they bought a bunch in 1995, some more in 1998, and heck they just kept buying them, the Checkpoint rep kept showing up and taking CISOs out to play golf, contracts got renewed, and poof - there goes the security budget.</div><br /><div>Consider that software security tools could grow 50% a year for five years and still be half of where Checkpoint is today.</div><br /><div>The optimistic way of looking at all this data is that there is major room for growth for software security, if you take network security as a target for a mature industry and assume that 2.3% is a reasonable margin of safety, then the software security space should evolve to around 2% of the software space meaning that it should evolve into a $2 billion space around fifteen times larger than it is today. Unprotected assets will either be protected or will cease to be assets, VCs get your check books ready.</div><br /><div>My friend Brian Chess has a nice way of looking at this he says 2007 was the turning point - &quot;the first year there was a bigger market for products that help you get code right than there was for products that help you demonstrate a problem exists.&quot;</div><br /><div>Now I am not suggesting that Information Security budgets have to be aligned with IT budget one for one, but I do think that looking at the overall IT budget is the starting point. If Information Security has a more cost effective security mechanism they should deploy it, but the starting point should be aligned to the business. Businesses spend most of their money on software, and there are very good reasons - competitive advantage, increased revenues and lower costs. Information Security spends most of its money on network security, and there is no good reason why, except that it was a seemingly good idea in 1995. You really don&#39;t have to go beyond the book value of IT investment as a whole versus Information Security to see a stunning disparity. Information Security&#39;s job is to deliver a Margin of Safety to the business, but they are not.&#0160;</div><br /><div>To deliver a real Margin of Safety to the business, I propose the following based on a defense in depth mindset. Break the IT budget into the following categories:</div><br /><div>- Network: all the resources invested in Cisco, network admins, etc.</div><div>- Host: all the resources invested in Unix, Windows, sys admins, etc.</div><div>- Applications: all the resources invested in developers, CRM, ERP, etc.</div><div>- Data: all the resources invested in databases, DBAs, etc.</div><br /><div>Tally up each layer. If you are like most business you will probably find that you spend most on Applications, then Data, then Host, then Network.</div><br /><div>Then do the same exercise for the Information Security budget:</div><br /><div>- Network: all the resources invested in network firewalls, firewall admins, etc.</div><div>- Host: all the resources invested in Vulnerability management, patching, etc.</div><div>- Applications: all the resources invested in static analysis, black box scanning etc.</div><div>- Data: all the resources invested in database encryption, database monitoring, etc.</div><br /><div>Again, tally each up layer. If you are like most business you will find that you spend most on Network, then Host, then Applications, then Data. Congratulations, Information Security, you are diametrically opposed to the business!</div><br /><div>Its not just about alignment for alignment&#39;s sake, its about applying controls as a way to have a Margin of Safety properly placed so that when not if there is a failure on a higher value asset you are relatively better positioned to deal with it.&#0160;</div><br /><div>The pure statistical approach can only take us so far. Buffett said he would be a lot poorer if all he did was listen to Ben Graham. Book value is great to see the diametric opposition mentioned above, but it doesn&#39;t really tell us much about the efficacy of the security mechanisms.</div><br /><div>What we do get out of this statistical approach is a screen. The asset value screen filters out subjective opinion and narrows the field for where we need to dig in to do the high value, time consuming analytical work.</div><br /><div>The second part of Warren Buffett&#39;s career and the second part of this talk leave behind pure statistical measures. In Warren Buffett&#39;s case he was joined by a guy named Charlie Munger who talked him out of the pure Ben Graham approach. Charlie Munger has a saying - &quot;a great business at a fair price beats a fair business at a great price.&quot; Where Graham was focused on price and margin of safety, Munger wants a fair price but also a high quality business. This lead to Warren Buffett&#39;s company Berkshire Hathaway investing in companies like Coca Cola, Wells Fargo, and American Express, where the prices were far from dirt cheap (as Graham would have wanted), but the long term returns were outstanding.</div><br /><div>In our world of Information Security, we start by aligning our priorities with the business using the thumbnail defense in depth approach, but then we would like to invest in high quality, effective controls.</div><br /><div>To get at the notion of control quality and effectiveness, I am going to start part 2 of this talk with a brief history of software. The first web software was just static HTML, but web software really got interesting when developers started creating dynamic websites using CGI an PERL.</div><br /><div>Once websites were hooked up to company databases and were not just serving static content, the security people realized they needed a security architecture, and they sprung into action. What they came up was was model that divided the world into &quot;good stuff&quot; which was comprised of all their networks, systems, and data; and then there was everything else the &quot;bad stuff&quot; on the Internet. So job one of the early days Internet security architecture was to separate all your good stuff (i.e. your network) for the bad stuff (the Internet). To do this the security people used a sophisticated tool called Visio to draw a flaming brick wall on the network diagram, and this flaming brick wall was supposed to keep the good stuff and the bad stuff separate.</div><br /><div>The security people also realized that the data and session tokens that they served up from their Web server would have to traverse the &quot;bad&quot; neighborhood called the Internet, so they added one more security mechanism to secure the last mile of the transaction - SSL between the browser and the Web server.</div><br /><div>And this was the state of the art security architecture used circa 1995 to protect the earliest dynamic web applications.</div><br /><div>What happened next was that the dotcom boom started to happen and businesses realized they could make some real money on the Web, the web apps started to get more sophisticated, more personalization, richer session experiences and so on. This led the Java people to create JSP and the Microsoft people to create ASP, and of course the PERL people to create even greasier PERL scripts, all of this in the effort to pooling resources and sessions on the Web server. The security people defended this new application programming model with network firewall and SSL.</div><br /><div>Around 1998, developers began building out more distributed N tier or 3 tier applications that separated the business logic layer, the presentation layer and the data access layer. Among other things, your web application could seamlessly integrate data from multiple back ends systems. Let&#39;s say you have pricing data in Oracle, order data in SAP, and customer data in a Mainframe. You write separate data access objects, apply business logic in the middle tier and then you tie it all together in a friendly user interface. At this point the web applications are beginning to integrate across departments and geographic boundaries, huge critical chunks of the business are now connected to the web. How did the security people defend this part of the business? They applied the same 1995 security architecture - network firewall and SSL.</div><br /><div>Around 1999-2000 timeframe businesses relied on web applications for major parts of the revenue, and the apps were built in different technologies like Java and Microsoft technologies, but the customer didn&#39;t care (still doesn&#39;t), the customer wanted (and still wants) data access and functionality. So to integrate the disparate technologies, SOAP and XML were deployed so that Microsoft could talk to Java and so Websphere could talk to Weblogic and so on. And, oh yes, SOAP and XML were used to connect B2B networks so partners in a supply chain and business process can exchange data and interoperate. &#0160;SOAP and XML present a fundamentally new programming model based on a message document style integration, where XML is used to mesh together data and functionality across platforms. SOAP and XML have no security model by default for authentication, authorization, and confidentiality. How did the security people deal with this? They kept the security architecture the same as they had in 1995 - network firewalls and SSL.</div><br /><div>The software world did not stop innovating in 2000 of course, in the last few years we have seen Web services and XML form the basis of baroque and powerful SOAs and simple REST applications. We have seen Web 2.0 come on the scene, and entirely new networked applications built on top of that.</div><br /><div>What we have not seen, is a single meaningful change in security architecture in 13 years. Developers have evolved, businesses have increasingly bet their entire business models on the web and they have increased security budgets. But what has the security architecture as its deployed in the field got to show for all of this? More firewalls and more SSL connections.</div><br /><div>Since Information Security has proven incapable of evolving, it is time to learn from a discipline that has mastered innovation - software development, and yes, I will step back in case the lightning bolts hits.</div><br /><div>What does software development focus on these days? Well, let&#39;s look at Service Oriented Architecture (SOA), all hype aside I look at SOA as a set of technologies that delivers three things:</div><br /><div>Virtualization: we want Beijing, Bangalore and Boston to communicate.</div><br /><div>Interoperability: we want our .Net stuff to talk to our java stuff.</div><br /><div>Reusability: how many order/claim/pricing/customer systems does one company need?</div><br /><div>To build out their SOA, developers separated the application interface from its implementation. So you can host the interface in a variety of locations, but its separate from the application logic and data.</div><br /><div>This is also a useful trick for putting services like SOAP through the firewall. SOAP was designed as a firewall friendly protocol. When SOAP first came out, Bruce Schneier said calling SOAP a firewall friendly protocol is like having a skull friendly bullet. Which is a great line and explains why his books fly off the shelves, it does not explain, why security people think an architecture designed in 1995 is the one we should be using today. Maybe the problem is not that the developers figured out how to go through the firewall to get the data their customers want, maybe the problem is that the firewall is the sum total of the security architecture, and it never adapted.</div><br /><div>A big part of this problem is that we have left Newton&#39;s world behind and entered Einstein&#39;s universe. Mainframes are Newton’s world, we have THE computer, THE price, THE record and so on.</div><br /><div>As Pat Helland explained [4,5], Mainframes are Newron&#39;s world, but Distributed computing is Einstein’s world. More specifically in the Einstein world of distributed computing - &quot;Computers don’t make decisions, computers try &#0160;to make decisions.&quot; Our computers don&#39;t really make a decision, they say you can buy this book from Amazon at this price, we have it in stock and will deliver on such and such a date. But the warehouse runs out, the pallet gets dropped in the warehouse, your boo is crushed, and the package is stolen off your front step. The computer confirmed your transaction, but the real world intervened.</div><br /><div>So we don&#39;t have iron clad decisions, instead its all about Memories (last time I checked your book was in stock), Guesses (we should be able to ship on this date) and Apologies (sorry the forklift ran over your book)</div><br /><div>Translating this into security, security mechanisms don’t make policy-based decisions, security mechanisms try to make policy-based decisions</div><br /><div>Some examples of memories, guesses and apologies in security</div><br /><div>Memories</div><div>Security Policies - for example Triple A policy</div><div>Triple A policies can memorize a map of subjects, objects, and roles. They can even replicate these memories and play them back at runtime to try to make policy enforcement decisions.</div><br /><div>Guesses</div><div>Security Policy Enforcement Decision</div><div>Unfortunately, while the policy enforcement decisions can be based on memorized logic, the decision itself is still a guess, even in the case of Triple A. Any guesses why? Because, the authentication process itself is a guess. It happens to be a guess that you then bind to a principal so it looks very official once you bind your guess to a Kerberos ticket or SAML assertion, but it still a guess.</div><br /><div>Apologies</div><div>Giant Global Bank is sorry your account was compromised!</div><div>And this leads to lots and lots of apologies by companies with poor access control models.</div><br /><div>Some additional examples of information security memories, guesses and apologies.</div><br /><div>Example Memories - Triple A Security Policies, Audit logs, User account information , Authorization Logic - concrete mapping Subject, Resource, Condition, Action</div><br /><div>Example Guesses - Security Policy Enforcement Decision Points, Authentication Logic, Monitoring, detection, fraud response</div><br /><div>Example Apologies - Identity Management tools - provisioning, deprovisioning, Reimburse customer for fraud losses, Compensating Transaction - Giant Global Bank is still sorry your account was compromised!</div><br /><div>The point of this is that security memories, guesses and apologies utilize different processes, different people, and different capabilities to be effective.</div><br /><div>What trends can we identify to lead us toward better qualitative analysis based on the best practices of virtualization, interoperability and reusability.</div><br /><div>Virtualization</div><div>Finding Vulnerabilities in a Virtualized World is a problem because applications are more configured than coded. Runtime behavior and structure not apparent due to weak typing and inversion of control.</div><br /><div>Result - finding bugs becomes harder. Action - use screens to target finding time and resources</div><br /><div>Fixing Vulnerabilities in a Virtualized World is a problem because how do I locate the controls when interfaces run in Beijing, Bangalore and Boston?</div><br /><div>Result - synchronization and/or replication of security policy is problematic. Action - decentralized policy enforcement points and policy decision points. &#0160;</div><br /><div>Interoperability</div><div>Finding interoperable vulnerabilities</div><div>XSS - Javascript is an equal opportunity offender - interoperability for developers and attackers alike.</div><br /><div>Fixing interoperable vulnerabilities</div><div>App servers, ESBs, and services are the attacker’s red carpet to your enterprise, right into your book of business. Interoperable access control can be leveraged across the enterprise.</div><br /><div>Use XML signature for authentication and integrity&#0160;</div><br /><div>&lt;SOAP:Envelope&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;SOAP:Header&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;WSSE:Security&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">			</span>&lt;ds:Signature&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">				</span>&lt;ds:Reference URI=‘#body’&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;/WSSE:Security&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;/SOAP:Header&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;SOAP:Body wsu:Id=‘body’&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>…</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;/SOAP:Body&gt;</div><div>&lt;SOAP:Envelope&gt;</div><br /><div>Use XML encryption to protect sensitive data, don&#39;t pass sensitive data in the clear</div><br /><div>&lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;</div><div>&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;</div><br /><div>&lt;soapenv:Body&gt;&lt;ns1:echo xmlns:ns1=&quot;http://sample01.samples.rampart.apache.org&quot;&gt;</div><br /><div><span class="Apple-tab-span" style="white-space:pre">	</span>&lt;param0&gt;My Credit Card Number&lt;/param0&gt;</div><div>&lt;/ns1:echo&gt;</div><div>&lt;/soapenv:Body&gt;</div><div>&lt;/soapenv:Envelope&gt;</div><br /><div>Encrypt the data</div><br /><div>&#0160;&lt;wsse:Security xmlns:wsse=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot; soapenv:mustUnderstand=&quot;1&quot;&gt;…</div><div>&#0160;&#0160; &#0160; &#0160; &#0160; &#0160; &#0160;&lt;xenc:EncryptedKey Id=&quot;EncKeyId-3020592&quot;&gt;</div><div>&#0160;&#0160; &#0160; &#0160; &#0160; &#0160; &#0160; &#0160; &lt;xenc:EncryptionMethod Algorithm=&quot;http://www.w3.org/2001/04/xmlenc#rsa-1_5&quot; /&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span> &lt;xenc:CipherValue&gt;</div><div>XNQ0a4legiie5mWFxO6CQkk2hhldYNnKroObue/LXS/VYtvaTgMbCujhGExDi+vlkU//Qc2/T6mx0WVTmBMT3z8rogha8jD+nS9Zr2Bc3CwoTh2lh8wL3D0DEu91iwJT9JByLGXvt7v9lyuxK0ooDOYEClsH974CPmTs3tBC+GQ=</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>&lt;/xenc:CipherValue&gt; &#0160; &#0160; &#0160; &#0160; &#0160; &#0160; &#0160;&#0160;</div><div>&lt;/xenc:CipherData&gt;</div><br /><div>To ensure that these controls are applied use automated tools like static analysis to scan for security mechanism use and coverage.</div><br /><div>In terms of reusability findings and fixes consider two bug findings</div><br /><div>Session management bug: session state is passed around to every component, service and user. Makes for many high priority findings in audit report, also the fix is required on virtually every program</div><br /><div>Data validation bug: Data access object (DAO) has a SQL injection hole. One major high priority finding in report. DAO used by many business logic classes, one fix location serves many classes&#0160;</div><br /><div>To bring these factors together, I generally use a scorecard index [6], so you can measure such things as transport security, message security, threat protection and so on. The hard work in developing the index is developing a useful scale. A scale for XML tokens could use the following</div><br /><div>0: no token</div><div>1: hashed token</div><div>2: hashed and signed token</div><div>3: hashed and signed token from standard authoritative source</div><br /><div>An example scale for XML validation could use:</div><br /><div>0: no validation</div><div>1: schema validation</div><div>2: schema validation against hardened schema</div><div>3: schema validation against standard, hardened schema</div><br /><div>These indexed scales are used to show maturity across the factors in the scorecard. The first part of the talk described value, the value assessment is used to focus time and effort on high value assets. The value assessment can be determined quantitatively. There is hard analytical work to qualitatively determine the scorecard, index, and scales, the quantitative value assessment is used to screen out high value targets for these endeavors. The scoring index is used to track progress and improve quality over time. In the best case scenario, automated tools are used to perform the checks described in the index, and once security is automated just like software developers we may see security innovation make progress in years not decades.</div><br /><div>Thank you for your time.</div><br /><div>1 &quot;Risk Management is where the Money Is&quot; by Dan Geer,&#0160;<a href="http://catless.ncl.ac.uk/Risks/20.06.html">http://catless.ncl.ac.uk/Risks/20.06.html</a></div><br /><div>2 Berkshire Hathaway 2007 Shareholder Letter by Warren Buffett, <a href="http://www.berkshirehathaway.com/letters/2007ltr.pdf">http://www.berkshirehathaway.com/letters/2007ltr.pdf</a></div><br /><div>3 &quot;Software [In]security: Software Security Demand Rising, by Gary McGraw</div><div><a href="http://www.informit.com/articles/article.aspx?p=1237978">http://www.informit.com/articles/article.aspx?p=1237978</a></div><br /><div>4 &quot;SOA and Newton&#39;s Universe&quot; by Pat Helland, <a href="http://blogs.msdn.com/pathelland/archive/2007/05/20/soa-and-newton-s-universe.aspx">http://blogs.msdn.com/pathelland/archive/2007/05/20/soa-and-newton-s-universe.aspx</a></div><br /><div>5 &quot;Memories, Guesses and Apologies&quot; by Pat Helland, <a href="http://blogs.msdn.com/pathelland/archive/2007/05/15/memories-guesses-and-apologies.aspx">http://blogs.msdn.com/pathelland/archive/2007/05/15/memories-guesses-and-apologies.aspx</a></div><br /><div>6 &quot;Web Servicres Security Checklist&quot; by Gunnar Peterson, <a href="http://arctecgroup.net/pdf/WebServicesSecurityChecklist.pdf">http://arctecgroup.net/pdf/WebServicesSecurityChecklist.pdf</a></div>]]></content:encoded>
      <pubDate>Tue, 18 Nov 2008 19:47:55 +0000</pubDate>
      <category domain="http://securityratty.com/tag/information security">information security</category>
      <category domain="http://securityratty.com/tag/information">information</category>
      <category domain="http://securityratty.com/tag/information security spends">information security spends</category>
      <category domain="http://securityratty.com/tag/safety information security">safety information security</category>
      <category domain="http://securityratty.com/tag/versus information security">versus information security</category>
      <category domain="http://securityratty.com/tag/information security budgets">information security budgets</category>
      <category domain="http://securityratty.com/tag/information security budget">information security budget</category>
      <category domain="http://securityratty.com/tag/software security">software security</category>
      <category domain="http://securityratty.com/tag/software security space">software security space</category>
      <source url="http://1raindrop.typepad.com/1_raindrop/2008/11/the-economics-of-finding-and-fixing-vulnerabilities-in-distributed-systems-.html">The Economics of Finding and Fixing Vulnerabilities in Distributed Systems </source>
    </item>
    <item>
      <title><![CDATA[U.S. Court Rules that Hashing = Searching]]></title>
      <link>http://securityratty.com/article/7ac2f8f38d5a22965aa52dc5f5dd9471</link>
      <guid>http://securityratty.com/article/7ac2f8f38d5a22965aa52dc5f5dd9471</guid>
      <description><![CDATA[Really interesting post by Orin Kerr on whether, by taking hash values of someone's hard drive, the police conducted a &quot;search&quot;: District Court Holds that Running Hash Values on Computer Is A Search:...]]></description>
      <content:encoded><![CDATA[<p><a href="http://volokh.com/archives/archive_2008_10_26-2008_11_01.shtml#1225159904">Really interesting post</a> by Orin Kerr on whether, by taking hash values of someone's hard drive, the police conducted a "search":</p>

<blockquote><b>District Court Holds that Running Hash Values on Computer Is A Search:</b>   The case is <a href="http://volokh.com/files/USA_v._Crist,_order-1.pdf"><i>United States v. Crist</i>, 2008 WL 4682806 (M.D.Pa. October 22 2008) (Kane, C.J.)</a>.  It's a child pornography case involving a warrantless search that raises a very interesting and important question of first impression: Is running a hash a Fourth Amendment search? (For background on what a "hash" is and why it matters, see <a href="http://www.harvardlawreview.org/forum/issues/119/dec05/salgado.pdf">here</a>). 

<p>First, the facts.  Crist is behind on his rent payments, and his landlord starts to evict him by hiring Sell to remove Crist's belongings and throw them away.  Sell comes a cross Crist's computer, and he hands over the computer to his friend Hipple who he knows is looking for a computer.  Hipple starts to look through the files, and he comes across child pornography: Hipple freaks out and calls the police.  The police then conduct a warrantless forensic examination of the computer: </p>

<blockquote>In the forensic examination, Agent Buckwash used the following procedure. First, Agent Buckwash created an "MD5 hash value" of Crist's hard drive. An MD5 hash value is a unique alphanumeric representation of the data, a sort of "fingerprint" or "digital DNA." When creating the hash value, Agent Buckwash used a "software write protect" in order to ensure that "nothing can be written to that hard drive." Supp. Tr. 88. Next, he ran a virus scan, during which he identified three relatively innocuous viruses. After that, he created an "image," or exact copy, of all the data on Crist's hard drive.

<p>Agent Buckwash then opened up the image (not the actual hard drive) in a software program called EnCase, which is the principal tool in the analysis. He explained that EnCase does not access the hard drive in the traditional manner, i.e., through the computer's operating system. Rather, EnCase "reads the hard drive itself." Supp. Tr. 102. In other words, it reads every file-bit by bit, cluster by cluster-and creates a index of the files contained on the hard drive. EnCase can, therefore, bypass user-defined passwords, "break down complex file structures for examination," and recover "deleted" files as long as those files have not been written over. Supp. Tr. 102-03.</p>

<p>Once in EnCase, Agent Buckwash ran a "hash value and signature analysis on all of the files on the hard drive." Supp. Tr. 89. In doing so, he was able to "ingerprint" each file in the computer. Once he generated hash values of the files, he compared those hash values to the hash values of files that are known or suspected to contain child pornography. Agent Buckwash discovered five videos containing known child pornography. Attachment 5. He discovered 171 videos containing suspected child pornography.</blockquote></p>

<p>One of the interesting questions here is whether the search that resulted was within the scope of Hipple's private search; different courts have approached this question differently.  But for now the most interesting question is whether running the hash was a Fourth Amendment search.  The Court concluded that it was, and that the evidence of child pornography discovered had to be suppressed:</p>

<blockquote>The Government argues that no search occurred in running the EnCase program because the agents "didn't look at any files, they simply accessed the computer." 2d Supp. Tr. 16. The Court rejects this view and finds that the "running of hash values" is a search protected by the Fourth Amendment.

<p>Computers are composed of many compartments, among them a "hard drive," which in turn is composed of many "platters," or disks.  To derive the hash values of Crist's computer, the Government physically removed the hard drive from the computer, created a duplicate image of the hard drive without physically invading it, and applied the EnCase program to each compartment, disk, file, folder, and bit.2d Supp. Tr. 18-19. By subjecting the entire computer to a hash value analysis-every file, internet history, picture, and "buddy list" became available for Government review. Such examination constitutes a search.</blockquote></p>

<p>I think this is generally a correct result: See my article <i><a href="http://www.harvardlawreview.org/issues/119/Dec05/Kerr.pdf">Searches and Seizures in a Digital World</i>, 119 Harv. L. Rev. 531 (2005)</a>, for the details.  Still, given the lack of analysis here it's somewhat hard to know what to make of the decision. Which stage was the search &mdash; the creating the duplicate?  The running of the hash? It's not really clear. I don't think it matters very much to this case, because the agent who got the positive hit on the hashes didn't then get a warrant.  Instead, he immediately switched over to the EnCase "gallery view" function to see the images, which seems to be to be undoudtedly a search. Still, it's a really interesting question.</blockquote></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=QHRfN"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=QHRfN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=N1NAN"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=N1NAN" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Wed, 05 Nov 2008 05:28:17 +0000</pubDate>
      <category domain="http://securityratty.com/tag/actual hard drive">actual hard drive</category>
      <category domain="http://securityratty.com/tag/hard drive">hard drive</category>
      <category domain="http://securityratty.com/tag/hard">hard</category>
      <category domain="http://securityratty.com/tag/md5 hash">md5 hash</category>
      <category domain="http://securityratty.com/tag/hash">hash</category>
      <category domain="http://securityratty.com/tag/hash values">hash values</category>
      <category domain="http://securityratty.com/tag/warrantless forensic examination">warrantless forensic examination</category>
      <category domain="http://securityratty.com/tag/agent">agent</category>
      <category domain="http://securityratty.com/tag/forensic examination">forensic examination</category>
      <source url="http://www.schneier.com/blog/archives/2008/11/us_court_rules.html">U.S. Court Rules that Hashing = Searching</source>
    </item>
    <item>
      <title><![CDATA[Investing in Your IT Security Career in Tough Times]]></title>
      <link>http://securityratty.com/article/73dfed3db4d8429f88c002b4ea28bf53</link>
      <guid>http://securityratty.com/article/73dfed3db4d8429f88c002b4ea28bf53</guid>
      <description><![CDATA[When meeting someone new and describing my background in this industry I often say &quot;I've seen the best of times, I've seen the worst of times and most of what falls in between.&quot; I've been recruiting...]]></description>
      <content:encoded><![CDATA[When meeting someone new and describing my background in this industry I often say "I've seen the best of times, I've seen the worst of times and most of what falls in between." I've been recruiting in Information Security long enough to have experienced the heady times of the dot.com boom and the dark days that followed after it all came crashing down. I've also been here as the industry has grown and evolved-sometimes as a result of and sometimes in spite of significant difficulties. This evolution leads to adaptation, and it's the ability of people to adapt and rise above one challenge after another that makes our industry so dynamic.]]></content:encoded>
      <pubDate>Mon, 03 Nov 2008 21:00:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/times">times</category>
      <category domain="http://securityratty.com/tag/heady times">heady times</category>
      <category domain="http://securityratty.com/tag/industry">industry</category>
      <category domain="http://securityratty.com/tag/dark days">dark days</category>
      <category domain="http://securityratty.com/tag/significant difficulties">significant difficulties</category>
      <category domain="http://securityratty.com/tag/evolution leads">evolution leads</category>
      <category domain="http://securityratty.com/tag/information security">information security</category>
      <category domain="http://securityratty.com/tag/worst">worst</category>
      <category domain="http://securityratty.com/tag/challenge">challenge</category>
      <source url="http://www.networkworld.com/news/2008/110408-investing-in-your-it-security.html?fsrc=rss-security">Investing in Your IT Security Career in Tough Times</source>
    </item>
    <item>
      <title><![CDATA[Stop Me if This Sounds Familiar]]></title>
      <link>http://securityratty.com/article/07468c09eca48cc8bfe532a83b3d394a</link>
      <guid>http://securityratty.com/article/07468c09eca48cc8bfe532a83b3d394a</guid>
      <description><![CDATA[My favorite book from last year was Charlie Munger's &quot;Poor Charlie's Almanack&quot; , there are so many fascinating parts in the book I can't go into them all here. Charlie Munger is Warren Buffett's...]]></description>
      <content:encoded><![CDATA[<p><a href="http://www.poorcharliesalmanack.com/index.html" style="float: left;"><img alt="Cover3rd" class="at-xid-6a00d83451c75869e2010535d3d4a3970c " src="http://1raindrop.typepad.com/.a/6a00d83451c75869e2010535d3d4a3970c-120wi" style="margin: 0px 5px 5px 0px;" /></a>
 My favorite book from last year was Charlie Munger&#39;s <a href="http://www.poorcharliesalmanack.com/index.html">&quot;Poor Charlie&#39;s Almanack&quot;</a>, there are so many fascinating parts in the book I can&#39;t go into them all here. Charlie Munger is Warren Buffett&#39;s partner at Berkshire Hathaway, the book is a collection of a number of his speeches, and serves as a great backdrop for today&#39;s events, an &#0160;investing education, and a way to think through complex problems (&quot;invert! always invert!&quot;). It goes without saying that I think you should buy this book.&#0160;</p><br /><div>Chapter Three is a collection of Munger&#39;s unscripted remarks at Berkshire Hathaway and Wesco annual meetings. The below sections were transcribed by <a href="http://www.tilsonfunds.com/">Whitney Tilson</a>, &#0160;from annual meetings around the 2003-4 time period, and are pretty interesting given our current financial predicament.</div><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><p><span style="font-weight: bold; ">Warnings About Financial Institutions and Derivatives</span></p><p><span style="font-weight: bold; ">Risks of Financial Institutions</span><br />The nature of a financial institution is that there are a lot of ways to go to hell in a bucket. You can push credit too far, do a dumb acquisition, leverage yourself excessively---its not just derivatives [that can bring about your downfall].</p><p>Maybe it&#39;s unique to us, but we&#39;re quite sensitive to financial risks. Financial institutions make us nervous when they&#39;re trying to do well.</p><p>We&#39;re exceptionally goosey of leveraged financial institutions. If they start talking about how good their risk management is, it makes us nervous.</p><p>We fret way earlier than other people. We&#39;ve left a lot of money on the table through early fretting. It&#39;s the way we are -- you&#39;ll just have to live with it.</p><p><span style="font-weight: bold; ">Derivatives</span><br />The system is almost insanely irresponsible. and what people think are fixes aren&#39;t realy fixes. It&#39;s so complicated I can&#39;t do it justice here - but you can&#39;t believe the trillions of dollars involved. You can&#39;t believe the complexity. You can&#39;t believe how difficult it is to do the accounting. You can&#39;t believe how big the incentives are to have wishful thinking about values and wishful thinking about ability to clear.</p><p>People don&#39;t think about the consequences of the consequences. People start by trying to hedge against interest rate changes, which is very difficult and complicated. Then, the hedges make the [reported profits] lumpy. So they use the new derivatives to smooth this. Well, now you&#39;ve morphed into lying. This turns into a Mad Hatter&#39;s Tea Party. This happens to vast, sophisticated corporations.</p><p>Somebody has to step in and say, &quot;We&#39;re not going to do it - it&#39;s just too hard.&quot;</p><p>I think a good litmus test of the mental and moral quality at any large institutions [with significant derivative exposure] would be to ask them, &quot;Do you really understand your derivatives book?&quot; Anyone who says yes is either crazy or lying.</p><p>It&#39;s easy to see [the dangers] when you talk about [what happened with] the energy derivatives - they went kerflooey. When [the companies] reached for the assets that were on their books, the money wasn&#39;t there. When it comes to financial assets, we haven&#39;t had any such denouement and the accountings hasn&#39;t changed so the denouement is ahead of us.</p><p>Derivatives are full of clauses that say if one party&#39;s credit gets downgraded then it has to put up collateral. It&#39;s like margin - you can go broke [just putting up more margin]. In an attempt to protect themselves, they&#39;ve introduced instability. Nobody seems to recognize what a disaster of a system they&#39;ve created. It&#39;s a demented system.&#0160;</p><p>In engineering people have a big margin of safety. But in the financial world, people don&#39;t give a damn about safety. They let it balloon and balloon and balloon. It&#39;s aided by false accounting. I&#39;m more pessimistic about this than Warren is.</p><p><span style="font-weight: bold; ">Accounting for Derivatives</span><br />I hate with a passion GAAP [Generally Accepted Accounting Principles] as applied to derivatives and swaps. JP Morgan sold out to this type of accounting to front-end revenues. I think it&#39;s a disgrace.</p><p>It&#39;s bonkers, and the accountants sold out. Everyone caved, adopted loose [accounting] standards, and created exotic derivatives linked to theoretical models. As a result, all kinds of earnings, blessed by accountants, are not really being earned. When you reach for the money, it melts away. It was never there.</p><p>It [accounting for derivatives] is just disgusting. It is a sewer, and if I&#39;m right, there will be hell to pay in due course. All of you will have to prepare to deal with a blowup of derivative books.</p><p><span style="font-weight: bold; ">Likelihood of a Derivatives Blowup</span><br />We tried to sell Gen Re&#39;s derivatives operations and couldn&#39;t, so we started liquidating it. We had to take big markdowns. I would confidently predict that most of the derivatives books of [this country&#39;s] major banks cannot be liquidated for anything like what they&#39;re carried on the books at. When the denouement will happen and how severe it will be, I don&#39;t know. But I fear the consequences could be fearsome. I think there are major problems, worse than in the energy field, and look at the destruction there.</p><p>I&#39;ll be amazed if we don&#39;t have some kind of significant [derivatives-related] blowup in the next five to ten years.</p><p>I think we&#39;re he only big corporation in America to be running off its derivative book.</p><p>It&#39;s a crazy idea for people who are already rich - &#0160;like Berkshire - to be in this business. It&#39;s a crazy business for big banks to be in.</p><p>Yo would be disgusted if you had a fair mind and spent a month really delving into a big derivative operation. You would think it was Lewis Carroll. You would think it was the Mad Hatter&#39;s Tea Party. And the false precision of these people is just unbelievable. They make the worst economics professors look like gods. Moreover, there is depravity augmenting the folly. Read the book F.I.A.S.C.O., by law professor and former derivative trader Frank Partnoy, an insider account of the depravity of derivative trading at one of the biggest and best-regarded Wall Street firms. This book will turn your stomach.</p></blockquote><br /><div>These are very blunt warnings from a legendary investor over many years, yet no one listened. It does explain why it is so hard for Infosec to make its case for building margins of safety into the system.</div><br /><br /><br />]]></content:encoded>
      <pubDate>Sun, 02 Nov 2008 19:30:30 +0000</pubDate>
      <category domain="http://securityratty.com/tag/derivatives book">derivatives book</category>
      <category domain="http://securityratty.com/tag/book">book</category>
      <category domain="http://securityratty.com/tag/derivatives">derivatives</category>
      <category domain="http://securityratty.com/tag/derivative books">derivative books</category>
      <category domain="http://securityratty.com/tag/books">books</category>
      <category domain="http://securityratty.com/tag/derivatives blowup">derivatives blowup</category>
      <category domain="http://securityratty.com/tag/derivatives operations">derivatives operations</category>
      <category domain="http://securityratty.com/tag/blowup">blowup</category>
      <category domain="http://securityratty.com/tag/favorite book">favorite book</category>
      <source url="http://1raindrop.typepad.com/1_raindrop/2008/11/stop-me-if-this-sounds-familiar.html">Stop Me if This Sounds Familiar</source>
    </item>
    <item>
      <title><![CDATA[PasswordTextBox]]></title>
      <link>http://securityratty.com/article/4e1580792b56914339b6489792b99933</link>
      <guid>http://securityratty.com/article/4e1580792b56914339b6489792b99933</guid>
      <description><![CDATA[Chris Sells used to poke fun at me when we worked together in my former life . He used to call my security class, &quot;Essential Access Denied&quot;. His point was a good one: when they aren't applied...]]></description>
      <content:encoded><![CDATA[<p><a href="http://www.sellsbrothers.com/" target="_blank">Chris Sells</a> used to poke fun at me when we worked together in my <a href="http://www.flickr.com/photos/andyrs/240203382/" target="_blank">former life</a>. He used to call my security class, &quot;Essential Access Denied&quot;. His point was a good one: when they aren&#39;t applied carefully, security countermeasures often just get in the way of getting work done. I don&#39;t know about you, but password-mode text boxes in web forms have always been one of those annoyances.</p> <p>I&#39;m not complaining about the fact that I can&#39;t see what I&#39;m typing. I understand and laud that feature, because I don&#39;t want someone looking over my shoulder at the password I&#39;m typing, and this even applies when I&#39;m at home. I love my children, but I certainly don&#39;t want them knowing the password to my bank account!</p> <p>No, what I&#39;m bothered by is how a typical password text box behaves on a form that may incur multiple post-backs before it&#39;s finally submitted. If you use the built in ASP.NET TextBox control, it purposely does not repopulate the password text, which means if you press a button on the form that performs a post-back, or if you have a multi-page form that posts back on every step, that password disappears, and the user typically has to re-enter it. You could solve this with liberal use of ASP.NET Ajax UpdatePanels, but that adds its own complexities. I wanted a simpler solution.</p> <p>So I did a little research to see what others had discovered about this problem, and I ended up deriving my own custom control from TextBox to make a much more user-friendly (and developer-friendly) TextBox control. I called it PasswordTextBox, and it acts just like a TextBox in password mode, but it retains the password while still giving the user the same level of protection the standard TextBox supplies.</p> <p>My PasswordTextBox operates very simply: it stores the password in control state, and renders a series of fixed characters (with the same length as the actual password) into the text box so that it &quot;looks&quot; like the user&#39;s password has been rendered. Since control state is part of view state, and since view state is stored in a hidden field on the form, I encrypt the password before putting it into control state.</p> <p>The result is quite nice - the user can post your form back as many times as she needs to, perhaps moving back and forth across wizard steps or tabs, and when she finally presses the &quot;Finish&quot; button (or whatever you call the last step of your input form), your code will be able to read the password by simply accessing the Text property on the PasswordTextBox. The user will believe that her password is sitting there on the form while she&#39;s working, as the same number of obfuscated characters will show up in the field as she typed in originally (what she doesn&#39;t know is that those characters aren&#39;t her real password anymore, but what she doesn&#39;t know won&#39;t hurt her!)</p> <p>Note that to keep this simple, I used DPAPI to encrypt the password, which suited my purposes. But if you have a web farm, that won&#39;t work well at all if you don&#39;t know which machine the user&#39;s going to post back to, so you&#39;ll want to replace that with something more robust. I could see looking up the &lt;machineKey&gt; for entropy, as that tends to be sync&#39;d already across the farm, but I&#39;ve not yet spent the cycles to go down that road, since unfortunately all of the code for generating keys based on that config section are off limits in ASP.NET (most of the useful stuff is marked internal). I don&#39;t think it&#39;d be that hard to do though.</p> <p>Anyway, without further ado, here&#39;s the code, which you&#39;ll see is quite simple. I&#39;d love feedback, especially if you see any glaring problems with the idea or the implementation!</p><pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> PasswordTextBox : TextBox
{
    <span class="rem">// unlikely that a string of these would be used for a password</span>
    <span class="kwrd">const</span> <span class="kwrd">char</span> PasswordPlaceholderChar = <span class="str">&#39;}&#39;</span>;

    <span class="kwrd">string</span> password; <span class="rem">// stored encrypted in control state</span>

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnInit(EventArgs e)
    {
        <span class="kwrd">base</span>.OnInit(e);
        Page.RegisterRequiresControlState(<span class="kwrd">this</span>);
    }

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">object</span> SaveControlState()
    {
        <span class="kwrd">byte</span>[] encryptedPassword = ProtectPassword(password);

        <span class="kwrd">object</span> baseControlState = <span class="kwrd">base</span>.SaveControlState();
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == baseControlState)
            <span class="kwrd">return</span> encryptedPassword;
        <span class="kwrd">else</span> <span class="kwrd">return</span> <span class="kwrd">new</span> Pair(baseControlState, encryptedPassword);
    }

    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> LoadControlState(<span class="kwrd">object</span> savedState)
    {
        <span class="kwrd">byte</span>[] encryptedPassword;

        Pair pair = savedState <span class="kwrd">as</span> Pair;
        <span class="kwrd">if</span> (<span class="kwrd">null</span> != pair)
        {
            <span class="kwrd">base</span>.LoadControlState(pair.First);
            encryptedPassword = pair.Second <span class="kwrd">as</span> <span class="kwrd">byte</span>[];
        }
        <span class="kwrd">else</span> encryptedPassword = savedState <span class="kwrd">as</span> <span class="kwrd">byte</span>[];

        password = UnprotectPassword(encryptedPassword);
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// This control always uses TextMode=Password</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">override</span> TextBoxMode TextMode
    {
        get
        {
            <span class="kwrd">return</span> TextBoxMode.Password;
        }
        set { }
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// TextBox doesn&#39;t render value attribute for TextMode=Password</span>
    <span class="rem">/// So we add code that renders a placeholder text instead</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name=&quot;writer&quot;&gt;&lt;/param&gt;</span>
    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> AddAttributesToRender(HtmlTextWriter writer)
    {
        <span class="kwrd">base</span>.AddAttributesToRender(writer);

        <span class="kwrd">string</span> text = Text;
        <span class="kwrd">if</span> (text.Length &gt; 0)
            writer.AddAttribute(HtmlTextWriterAttribute.Value,
                GetPlaceholderPassword(text));
    }

    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// TextBox doesn&#39;t save the &quot;Text&quot; viewstate in</span>
    <span class="rem">/// TextMode=Password and we don&#39;t want our behavior to break</span>
    <span class="rem">/// if ViewState is turned off so we store the password in</span>
    <span class="rem">/// Control State, encrypted with MachineKey</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> Text
    {
        get
        {
            <span class="kwrd">return</span> password ?? <span class="kwrd">string</span>.Empty;
        }
        set
        {
            <span class="rem">// this prevents us overwriting the actual</span>
            <span class="rem">// password with a placeholder</span>
            <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(password) &amp;&amp;
                <span class="kwrd">value</span>.Equals(GetPlaceholderPassword(password)))
                <span class="kwrd">return</span>;

            password = <span class="kwrd">value</span>;
        }
    }

    <span class="kwrd">private</span> <span class="kwrd">string</span> GetPlaceholderPassword(<span class="kwrd">string</span> realPassword)
    {
        <span class="kwrd">int</span> length = 12;
        <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(realPassword))
            length = realPassword.Length;

        StringBuilder sb = <span class="kwrd">new</span> StringBuilder();
        sb.Append(PasswordPlaceholderChar, length);

        <span class="kwrd">return</span> sb.ToString();
    }

    <span class="kwrd">public</span> <span class="kwrd">byte</span>[] ProtectPassword(<span class="kwrd">string</span> password)
    {
        <span class="kwrd">if</span> (<span class="kwrd">string</span>.IsNullOrEmpty(password))
            <span class="kwrd">return</span> <span class="kwrd">null</span>;
        <span class="kwrd">byte</span>[] cleartext = Encoding.UTF8.GetBytes(password);
        <span class="kwrd">return</span> ProtectedData.Protect(cleartext, <span class="kwrd">null</span>,
            DataProtectionScope.LocalMachine);
    }

    <span class="kwrd">public</span> <span class="kwrd">string</span> UnprotectPassword(<span class="kwrd">byte</span>[] ciphertext)
    {
        <span class="kwrd">if</span> (<span class="kwrd">null</span> == ciphertext)
            <span class="kwrd">return</span> <span class="kwrd">null</span>;
        <span class="kwrd">byte</span>[] cleartext = ProtectedData.Unprotect(ciphertext, <span class="kwrd">null</span>,
            DataProtectionScope.LocalMachine);
        <span class="kwrd">return</span> Encoding.UTF8.GetString(cleartext);
    }
}
</pre><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=54154" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 29 Oct 2008 16:49:54 +0000</pubDate>
      <category domain="http://securityratty.com/tag/password-mode text boxes">password-mode text boxes</category>
      <category domain="http://securityratty.com/tag/text">text</category>
      <category domain="http://securityratty.com/tag/return null">return null</category>
      <category domain="http://securityratty.com/tag/return">return</category>
      <category domain="http://securityratty.com/tag/net">net</category>
      <category domain="http://securityratty.com/tag/net ajax updatepanels">net ajax updatepanels</category>
      <category domain="http://securityratty.com/tag/net textbox control">net textbox control</category>
      <category domain="http://securityratty.com/tag/password">password</category>
      <category domain="http://securityratty.com/tag/textbox control">textbox control</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/10/29/passwordtextbox.aspx">PasswordTextBox</source>
    </item>
  </channel>
</rss>
