<?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>Chirashi Security &#187; OSX</title>
	<atom:link href="http://chirashi.zenconsult.net/category/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://chirashi.zenconsult.net</link>
	<description>A blog with scattered thoughts on security</description>
	<lastBuildDate>Sun, 16 Oct 2011 17:26:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Comparing JTR compiled on GCC and Clang</title>
		<link>http://chirashi.zenconsult.net/2011/07/comparing-jtr-compiled-on-gcc-and-clang/</link>
		<comments>http://chirashi.zenconsult.net/2011/07/comparing-jtr-compiled-on-gcc-and-clang/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 14:50:58 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Non Security]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Blowfish]]></category>
		<category><![CDATA[Clang]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[John the Ripper]]></category>
		<category><![CDATA[JtR]]></category>
		<category><![CDATA[LLVM]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=562</guid>
		<description><![CDATA[I bought the new XCode 4 recently and it is a pretty awesome IDE. I only recently got into Objective-C coding, but I have VERY quickly fallen in love with the language and the IDE.  I generally regarded my language of choice to be Java and my all time favorite IDE has been Eclipse, but [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://chirashi.zenconsult.net/wp-content/uploads/2011/07/Xcode_icon.png" width="240" />
		</p><p><a href="http://chirashi.zenconsult.net/wp-content/uploads/2011/07/Xcode_icon.png"><img class="alignnone size-full wp-image-563" title="XCode" src="http://chirashi.zenconsult.net/wp-content/uploads/2011/07/Xcode_icon.png" alt="XCode pwns!" width="100" height="100" /></a>I bought the new <a href="http://developer.apple.com/xcode/">XCode</a> 4 recently and it is a pretty awesome IDE. I only recently got into Objective-C coding, but I have VERY quickly fallen in love with the language and the IDE.  I generally regarded my language of choice to be Java and my all time favorite IDE has been Eclipse, but I&#8217;d have to say XCode and Objective C comes very very close to dethroning the Java/Eclipse combo.</p>
<p>Having said this, though, adapting to XCode 4 is a bit of a challenge after using XCode 3 for a while.  Have a look at this <a href="http://fireballed.org/linked/2011/03/09/xcode-pilkington/">awesome review</a> of XCode 4.  It helped me make some sense of the new features and how to wrap my head around using this magnificent beast.  As of this post, the one major point that I absolutely hated about XCode 4 is the actual purchase/download process.  It took me about 10 hours to download its gargantuan 4.5GB on a 6Mbit line.</p>
<p>Now that that&#8217;s out of the way, I wanted to get down to one of the front-page features of XCode 4: <a href="http://llvm.org/">LLVM</a>.  The Apple XCode <a href="http://developer.apple.com/technologies/tools/">page</a> states:</p>
<p><em>&#8220;Apple’s next generation compiler technology, the Apple LLVM compiler, does more than build your app. Apple LLVM technology is integrated into the entire development experience. The same parser used to build C/C++ and Objective-C powers Xcode’s indexing engine, providing incredibly accurate code completions. As you work, Apple LLVM is constantly evaluating what you type, identifying coding mistakes that Xcode shows as Live Issues, and thinking ahead for ways to Fix-it for you. Other compilers can tell you what is wrong &#8212; Apple LLVM can make it right.&#8221;</em></p>
<p>Being the curious type, I thought I&#8217;d give LLVM, or more specifically <a href="http://clang.llvm.org/">Clang</a>, a try.  I figured the best way to do this is to compare a program compiled with Clang against the same one compiled with the venerable GCC compiler.  While there are benchmarks that were done in 2010 (<a href="http://www.phoronix.com/scan.php?page=article&amp;item=gcc_llvm_clang&amp;num=1">here</a> and <a href="http://www.phoronix.com/scan.php?page=article&amp;item=llvm_gcc_dragonegg28&amp;num=1">here</a>), I wanted to verify how the latest version of Clang would perform.</p>
<h3>My test environment:</h3>
<ol>
<li>OS X 10.6.8 running on a Core 2 Duo 13&#8243; MacBook</li>
<li>Clang version 2.0 based on LLVM 2.9svn</li>
<li>GCC version 4.2.1 build 5666</li>
<li>John the Ripper 1.7.8 Jumbo 2 from <a href="http://www.openwall.com/john/">source</a></li>
</ol>
<p>To start off, I thought I&#8217;d test how long each compiler would take to build JTR.  I made two copies of the JTR source under &#8220;john-llvm&#8221; and &#8220;john-gcc&#8221;.  Then I edited the &#8220;john-llvm&#8221; Makefile and changed the &#8220;CC&#8221; parameter to &#8220;clang&#8221; from the default value of &#8220;gcc&#8221;.  I ran &#8220;make macosx-x86-64&#8243; on both directories after that.  Here are the respective build times (I used &#8220;time&#8221; to time the builds):</p>
<p><strong>Clang:</strong></p>
<ol>
<li>real 0m41.382s</li>
<li>user 0m37.316s</li>
<li>sys 0m2.648s</li>
</ol>
<p><strong>GCC:</strong></p>
<ol>
<li>real 0m38.721s</li>
<li>user 0m34.067s</li>
<li>sys 0m3.540s</li>
</ol>
<p>I then ran &#8220;john &#8211;test&#8221; on each build.  Here are the results for the &#8220;OpenBSD Blowfish (x32) [32/64 X2]&#8221; test:</p>
<p><strong>Clang:</strong></p>
<p>260 c/s real, 257 c/s virtual</p>
<p><strong>GCC:</strong></p>
<p>410 c/s real, 410 c/s virtual</p>
<h3>Conclusion</h3>
<p>Admittedly, I haven&#8217;t used any sophisticated test frameworks, and I&#8217;ve done more or less a &#8220;layman&#8217;s&#8221; set of tests.  But the results are clear: JTR compiled with GCC will crack your Blowfish password in half the time it would take for JTR compiled with Clang to do so.  It also takes less time to build JTR using GCC than it does to build it with Clang.</p>
<p>Obviously the hardware has a lot to do with test results and also the OS.  It would be interesting to see what the results look like when Lion is released this month.</p>
]]></content:encoded>
			<wfw:commentRss>http://chirashi.zenconsult.net/2011/07/comparing-jtr-compiled-on-gcc-and-clang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML unescape filter for BBEdit</title>
		<link>http://chirashi.zenconsult.net/2009/07/html-unescape-filter-for-bbedit/</link>
		<comments>http://chirashi.zenconsult.net/2009/07/html-unescape-filter-for-bbedit/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 06:48:30 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://chirashi.zensay.com/?p=43</guid>
		<description><![CDATA[So I played around with BBEdit for a while.  I needed an HTML unescape feature for some of the files i was working on, but couldn&#8217;t find one in BBEdit itself.  So I used the &#8220;Unix Filter&#8221; option in BBEdit, hacked my own Ruby script and had an unescape feature in a matter of minutes.  [...]]]></description>
			<content:encoded><![CDATA[<p>So I played around with BBEdit for a while.  I needed an HTML unescape feature for some of the files i was working on, but couldn&#8217;t find one in BBEdit itself.  So I used the &#8220;Unix Filter&#8221; option in BBEdit, hacked my own Ruby script and had an unescape feature in a matter of minutes.  If anyone is interested, grab this <a href="http://chirashi.zensay.com/wp-content/uploads/2009/07/unescape.rb">unescape script for BBEdit</a> and place it in your ~/Library/Application Support/BBEdit/Unix Support/Unix Filters/ directory.  You can then access the script by going to the #!-&gt;Unix Filters-&gt;unescape.rb filter.  Your ugly, XSS-safe, escaped document will then be converted to a more readable and pretty looking one.</p>
]]></content:encoded>
			<wfw:commentRss>http://chirashi.zenconsult.net/2009/07/html-unescape-filter-for-bbedit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

