<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jason Seifer &#187; Programming</title>
	<atom:link href="http://jasonseifer.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://jasonseifer.com</link>
	<description></description>
	<lastBuildDate>Fri, 27 Aug 2010 23:11:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>On Passwords</title>
		<link>http://jasonseifer.com/2010/03/21/on-passwords</link>
		<comments>http://jasonseifer.com/2010/03/21/on-passwords#comments</comments>
		<pubDate>Sun, 21 Mar 2010 10:00:11 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[passwords]]></category>

		<guid isPermaLink="false">http://jasonseifer.com/?p=355</guid>
		<description><![CDATA[On a recent episode of The Dev Show Dan and I talked about passwords. In particular, the topic of password hashing came up. I&#8217;d like to say up front that I&#8217;m not a security guy and most definitely not a cryptographer. However, I don&#8217;t have to be because there are much smarter people who have [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>On a recent episode of <a href="http://5by5.tv/devshow/4">The Dev Show</a> Dan and I talked about passwords. In particular, the topic of password hashing came up. I&#8217;d like to say up front that I&#8217;m not a security guy and most definitely not a cryptographer. However, I don&#8217;t <em>have</em> to be because there are much smarter people who have already done a lot of work on encryption schemes and have done it much better than I ever could.</p>
<div class="image_caption"><img src="http://jasonseifer.com/assets/2010/03/9EB3D76B-FB9C-43A5-B23D-CB6EB6EB28F9.jpg" alt="Spaceballs" border="0" width="360" height="240" /><br />
Above: discussion of best practices in passwords.
</div>
<p></p>
<p>This should go without saying: you shouldn&#8217;t be storing your passwords in plain text in your database. Unless you need to be able to retrieve the password later, it should be stored in the database in a hashed format. Thomas Ptacek, a very highly respected security professional, explains all you need to know about passwords in <a href="http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html">this blog post</a>. I&#8217;ll save you the trouble of reading the whole thing: just use <a href="http://en.wikipedia.org/wiki/Bcrypt">bcrypt</a> as your encryption scheme. It&#8217;s the slowest to generate the encrypted hash. By virtue of being slow to generate, it would also take a <em>very</em> long time to perform a successful lookup using <a href="http://en.wikipedia.org/wiki/Rainbow_tables">rainbow tables</a>. See that blog post linked for much more information and a thorough explanation.</p>
<p>Just how much longer does it take to generate? The following is a quick ruby program I whipped up to benchmark. It uses each encryption scheme to generate a password 50 times.  The following was how long it took to run on my macbook using ruby 1.9.1-p378.  You can grab the script <a href="http://gist.github.com/339346">here</a> if you&#8217;d like to run it locally. It contains absolutely no tests which makes my inner <a href="http://www.coreyhaines.com/">Corey Haines</a> frown:</p>
<pre>
  Password to hash: password
                    user     system      total        real
  MD5           0.000000   0.000000   0.000000 (  0.001443)
  SHA1          0.000000   0.000000   0.000000 (  0.001679)
  SHA256        0.000000   0.000000   0.000000 (  0.001308)
  bcrypt (3)    0.080000   0.000000   0.080000 (  0.086532)
  bcrypt (10)   4.550000   0.010000   4.560000 (  4.601996)
</pre>
<p>The differences between the (3) and (10) are the &quot;cost&quot; of generating the password. The documentation for the bcrypt gem summarizes that very well:</p>
<blockquote><p>
    Takes an optional :cost option, which is a logarithmic variable which determines how computational expensive the hash is to calculate (a :cost of 4 is twice as much work as a :cost of 3). The higher the :cost the harder it becomes for attackers to try to guess passwords (even if a copy of your database is stolen), but the slower it is to check users’ passwords.
  </p></blockquote>
<p>But I&#8217;m getting off topic. The reason I wanted to write this post was to create a list of popular open source software and see what kind of passwords hashing schemes are in use.  Here&#8217;s the list I&#8217;ve compiled so far:</p>
<ul>
<li>
<p><strong><a href="http://www.djangoproject.com/">Django</a></strong><br />
    <strong>Encryption Scheme: </strong>SHA1, MD5, or crypt<br />
    <strong>Notes: </strong>Previous Django versions, such as 0.90, used simple MD5 hashes without password salts. For backwards compatibility, those are still supported; they&#8217;ll be converted automatically to the new style the first time check_password() works correctly for a given user. More info:<br />
    <a href="http://docs.djangoproject.com/en/dev/topics/auth/">http://docs.djangoproject.com/en/dev/topics/auth/</a><br />
    <a href="http://docs.python.org/library/crypt.html">http://docs.python.org/library/crypt.html</a></td>
</p>
</li>
<li>
<p>
    <strong><a href="http://dev.mysql.com/">MySQL</a></strong><br />
    <strong>Encryption Scheme: </strong>Double SHA1
   </p>
</li>
<li>
<p>
        <strong><a href="http://wordpress.org">WordPress</a></strong><br />
        <strong>Encryption Scheme: <a href="http://www.openwall.com/phpass/">PHPass</a></strong><br />
        <strong>Notes</strong> The awkwardly named PHPass library defaults to bcrypt (awesome) and falls back to DES or MD5 based salted hashes depending on the php version and supported features.
      </p>
</li>
<li>
<p>
        <strong><a href="http://expressionengine.com/">Expression Engine</a></strong><br />
        <strong>Encryption Scheme: </strong> SHA1</p>
</li>
<li>
<p>
      <strong><a href="http://www.joomla.org/">Joomla</a></strong><br />
      <strong>Encryption Scheme: </strong> MD5
    </p>
</li>
<li>
<p>
      <strong><a href="http://phpbb.com">phpBB</a></strong><br />
      <strong>Encryption Scheme: </strong> Proprietary hash method using /dev/urandom and md5
    </p>
</li>
<li>
<p>
      <strong>ASP.Net Authentication</strong><br />
      <strong>Encryption Scheme: </strong> Uses a concept of &quot;<a href="http://msdn.microsoft.com/en-us/library/eeyk640h.aspx">providers</a>&quot;.<br />
      <strong>Notes: </strong> There&#8217;s a <a href="http://derekslager.com/blog/posts/2007/10/bcrypt-dotnet-strong-password-hashing-for-dotnet-and-mono.ashx">BCrypt</a> open source option available.</p>
</li>
<li>
<p>
      <strong>Rails: <a href="http://github.com/technoweenie/restful-authentication">restful-authentication</a></strong><br />
      <strong>Encryption Scheme: </strong> SHA1<br />
      <strong>Notes: </strong> This was the defacto standard for a long time in the Rails world as far as authentication goes. Changing the encryption scheme in an application would be a <em>relatively</em> painless process.
    </p>
</li>
<li>
<p>
      <strong>Rails: <a href="http://github.com/binarylogic/authlogic">Authlogic</a></strong><br />
      <strong>Encryption Scheme: </strong> bcrypt, aes256, md5, sha1, sha256, sha512<br />
      <strong>Notes: </strong> This is configurable to any of the listed options. Default is SHA512. The author doesn&#8217;t recommend using MD5 or SHA1 in the README but provides the options for migration and compaitiblity. How awesome is that?
    </p>
</li>
<li>
<p>
          <strong><a href="http://drupal.org/">Drupal</a></strong><br />
          <strong>Encryption Scheme: </strong> MD5 by default<br />
          <strong>Notes:</strong> Christefano points out in the comments that MD5 is used by default but PHPass and AES are available via third party modules.
       </p>
</li>
</ul>
<p>If you don&#8217;t see your favorite software here, either leave it in the comments or <a href="http://jasonseifer.com/contact">contact me</a> and I&#8217;ll add it to the list. These are in no particular order, so I&#8217;m not trying to favor anything in particular (though we all know I&#8217;m mostly a Ruby developer).</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=On+Passwords+http://bit.ly/awXjlj" title="Post to Twitter"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-twitter-micro1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Delicious"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Digg"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://jasonseifer.com/2010/03/21/on-passwords&amp;t=On+Passwords" title="Post to Facebook"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://jasonseifer.com/2010/03/21/on-passwords&amp;t=On+Passwords" title="Post to Facebook">Facebook</a> <a class="tt" href="http://reddit.com/submit?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Reddit"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://jasonseifer.com/2010/03/21/on-passwords&amp;title=On+Passwords" title="Post to Reddit">Reddit This Post</a></p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://jasonseifer.com/2010/03/21/on-passwords/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Using Concentrate for the Pomodoro Technique on OS X</title>
		<link>http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro</link>
		<comments>http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro#comments</comments>
		<pubDate>Mon, 08 Feb 2010 20:21:28 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[pomodoro]]></category>
		<category><![CDATA[technique]]></category>

		<guid isPermaLink="false">http://jasonseifer.com/?p=322</guid>
		<description><![CDATA[Concentrate is a Mac only app. It lets you do a number of things like block web sites, launch apps, play sounds, etc. Combinations of these things can be configured to go on for varying amounts of time. I use it for the Pomodoro Technique when programming. Corey Haines introduced me to Tomatoist when I [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://getconcentrating.com/"><img src="http://jasonseifer.com/assets/2010/02/concentrate.png" alt="concentrate.png" border="0" width="325" height="158" class="alignright" /></a></p>
<p><a href="http://getconcentrating.com/">Concentrate</a> is a Mac only app. It lets you do a number of things like block web sites, launch apps, play sounds, etc. Combinations of these things can be configured to go on for varying amounts of time. I use it for the <a href="http://www.pomodorotechnique.com/">Pomodoro Technique</a> when programming. <a href="http://coreyhaines.com/">Corey Haines</a> introduced me to <a href="http://tomatoi.st">Tomatoist</a> when I paired with him during one of his journeyman tours. While that site is awesome, I prefer using the Mac app to force eliminate distractions.</p>
<h3>The Pomodoro Technique</h3>
<p>The root of the idea is that you program for 25 minutes straight and then break for 5 minutes. This seems like a pretty simple idea but when you&#8217;re working by yourself things can happen. For example, maybe you want to send a quick email to someone but want to refer to something in their Facebook account you can&#8217;t quite remember. So then you look it up. While looking it up you notice something else interesting by another one of your friends and the distractions start. By the end of the distractions you&#8217;ve ordered enough parts for a fully functional robot suit off eBay. If you only had 5 minutes to do this stuff, maybe that wouldn&#8217;t have happened.</p>
<h3>Setting Up Concentrate</h3>
<p><a href="http://jasonseifer.com/assets/2010/02/concentrate-newtask.png"><img  class="alignright" src="http://jasonseifer.com/assets/2010/02/concentrate-newtask-300x291.png" alt="Concentrate New Task" border="0" width="300" height="291" /></a></p>
<p>Concentrate is actually a very simple application to use. Click on the &#8220;New Activity Button&#8221; and set your options. I called mine &quot;Program Pomodoro.&quot; It&#8217;s set to block any site that could potentially distract me, Growl a message, and play a sound on completion. The typical Pomodoro technique lasts 25 minutes so drag the location slider over until you see 25 minutes. Boom, good to go. Now you can&#8217;t look at anyone&#8217;s Facebook account or respond to any threads on <a href="http://news.ycombinator.com">hacker news</a> for a good 25 minutes.  You&#8217;ll get to that during your break.
</p>
<p><a href="ttp://jasonseifer.com/assets/2010/02/concentrate-activities.png"><img class="alignright" src="http://jasonseifer.com/assets/2010/02/concentrate-activities-300x236.png" alt="Concentrate Activities" border="0" width="300" height="236" /></a></p>
<p>The next task you&#8217;ll want to set up is the break. This is the most rewarding task. I just have this one Growl a message (&quot;Get back to work!&quot;) and play a sound when it&#8217;s done. The duration slider should be set to 5 minutes.
</p>
<h3>Get To It!</h3>
<p>That&#8217;s about it. It&#8217;s simple software and well worth the $30 to eliminate distractions. I use it only for those two techniques listed above and have been very happy. Special thanks to <a href="http://coreyhaines.com">Corey Haines</a> for introducing me to the Pomodoro technique.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X+http://bit.ly/cvI9b8" title="Post to Twitter"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-twitter-micro1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Delicious"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Delicious">Delicious</a> <a class="tt" href="http://digg.com/submit?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Digg"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Digg">Digg This Post</a> <a class="tt" href="http://www.facebook.com/share.php?u=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;t=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Facebook"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;t=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Facebook">Facebook</a> <a class="tt" href="http://reddit.com/submit?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Reddit"><img class="nothumb" src="http://jasonseifer.com/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro&amp;title=Using+Concentrate+for+the+Pomodoro+Technique+on+OS+X" title="Post to Reddit">Reddit This Post</a></p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://jasonseifer.com/2010/02/08/using-concentrate-for-pomodoro/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
