<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Java Security FUD</title>
	<atom:link href="http://www.nomachetejuggling.com/2007/02/27/java-security-fud/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nomachetejuggling.com/2007/02/27/java-security-fud/</link>
	<description>How a random programmer views the world.</description>
	<pubDate>Sat, 22 Nov 2008 07:48:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Michael Bevilacqua-Linn</title>
		<link>http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-7744</link>
		<dc:creator>Michael Bevilacqua-Linn</dc:creator>
		<pubDate>Tue, 17 Apr 2007 23:45:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-7744</guid>
		<description>Fun fact, you can fairly easily recover the last seed in a java.util.Random with just a single nextLong().  Not that it matters.  Why bother trying to make the output of a LCG "more random".  It works perfectly for what it's intended to do.  Simple, quick, everyday psedorandomness.  There are other algorithms that are more suited for when you need randomness for cryptographic, or other hard to predict, purposes. 

Oh, and I'm one of those folk that tries to avoid Java whenever possible :-)</description>
		<content:encoded><![CDATA[<p>Fun fact, you can fairly easily recover the last seed in a java.util.Random with just a single nextLong().  Not that it matters.  Why bother trying to make the output of a LCG &#8220;more random&#8221;.  It works perfectly for what it&#8217;s intended to do.  Simple, quick, everyday psedorandomness.  There are other algorithms that are more suited for when you need randomness for cryptographic, or other hard to predict, purposes. </p>
<p>Oh, and I&#8217;m one of those folk that tries to avoid Java whenever possible :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rod</title>
		<link>http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-6185</link>
		<dc:creator>Rod</dc:creator>
		<pubDate>Mon, 19 Mar 2007 08:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-6185</guid>
		<description>Juhani:

I don't think so.  For one thing, this was linked to in a CURRENT discussion about Java, as an example of Java's inferiority.  The fact that it's old doesn't matter - people are still saying Java is slow, and it hasn't been slow for a long time.  Old, outdated aspects of Java are relevant today because people are still using them, so showing why an older criticism is false is still valuable.

Also, the Random implementation hasn't changed - if you load his applet, you still see the effect.  This makes it somewhat relevant today as well.

It's also worth pointing out that SecureRandom, in fact, DID exist at the time he wrote that page, so it was just as wrong then as it is today. :)</description>
		<content:encoded><![CDATA[<p>Juhani:</p>
<p>I don&#8217;t think so.  For one thing, this was linked to in a CURRENT discussion about Java, as an example of Java&#8217;s inferiority.  The fact that it&#8217;s old doesn&#8217;t matter - people are still saying Java is slow, and it hasn&#8217;t been slow for a long time.  Old, outdated aspects of Java are relevant today because people are still using them, so showing why an older criticism is false is still valuable.</p>
<p>Also, the Random implementation hasn&#8217;t changed - if you load his applet, you still see the effect.  This makes it somewhat relevant today as well.</p>
<p>It&#8217;s also worth pointing out that SecureRandom, in fact, DID exist at the time he wrote that page, so it was just as wrong then as it is today. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juhani</title>
		<link>http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-6151</link>
		<dc:creator>Juhani</dc:creator>
		<pubDate>Sun, 18 Mar 2007 19:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-6151</guid>
		<description>I really like your blog, but one thing bothers me with this post. It says in the code that it is written in 1998. That's kind of a long time ago, don't you think? 

I have no idea how Java has developed but I'm still thinking it's a bit out-of-date proving a nine year old point on Java randomness wrong? Or is it?</description>
		<content:encoded><![CDATA[<p>I really like your blog, but one thing bothers me with this post. It says in the code that it is written in 1998. That&#8217;s kind of a long time ago, don&#8217;t you think? </p>
<p>I have no idea how Java has developed but I&#8217;m still thinking it&#8217;s a bit out-of-date proving a nine year old point on Java randomness wrong? Or is it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-4136</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 28 Feb 2007 18:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.nomachetejuggling.com/2007/02/27/java-security-fud/#comment-4136</guid>
		<description>Somehow I knew that sending you that link would provoke you. ;)

The analysis you provide is great, but I think you do miss his point. It's a well-known effect of LCGs that the low-order bits of the output are non-random. His suggestion (under the "proposal" link) was to take high-order bit and add that into the result before using it. 

This would only add one bit-shift operation and one addition : it's doubtful that those could cause any program to run significantly slower. (And if it does, we're back to the "Java really /is/ slow" argument. ;) The only time you could even possibly notice it is if you're generating millions of random numbers, and if you're doing that you'd probably really want a different algorithm /anyway/. Ergo, this simple change would significantly add to the quality of the "default" random number generator.

Also, it should be pointed out that there's a huge gap between Random and SecureRandom that could be meaningfully populated with other classes. SecureRandom isn't exactly the next step up, so much as the final step in the trade-off between random and fast. For instance, the Mersenne Twister algorithm is both fast and very random. (In fact, if you reference http://cs.gmu.edu/~sean/research/, the guy there claims it's faster than Random.)

Incidentally, this "random isn't" complaint is a common in C++ as well. Most default random number implementations are trash. Thus, I agree that the title "Sun Redefines Random" title is a bit uncharitable. Further, he's picking on a pretty well-known issue with the underlying algorithm, so he's not "groundbreaking" by any means. However, I think the solution he suggests has some merit, and this could be a place that Sun could improve on other languages.</description>
		<content:encoded><![CDATA[<p>Somehow I knew that sending you that link would provoke you. ;)</p>
<p>The analysis you provide is great, but I think you do miss his point. It&#8217;s a well-known effect of LCGs that the low-order bits of the output are non-random. His suggestion (under the &#8220;proposal&#8221; link) was to take high-order bit and add that into the result before using it. </p>
<p>This would only add one bit-shift operation and one addition : it&#8217;s doubtful that those could cause any program to run significantly slower. (And if it does, we&#8217;re back to the &#8220;Java really /is/ slow&#8221; argument. ;) The only time you could even possibly notice it is if you&#8217;re generating millions of random numbers, and if you&#8217;re doing that you&#8217;d probably really want a different algorithm /anyway/. Ergo, this simple change would significantly add to the quality of the &#8220;default&#8221; random number generator.</p>
<p>Also, it should be pointed out that there&#8217;s a huge gap between Random and SecureRandom that could be meaningfully populated with other classes. SecureRandom isn&#8217;t exactly the next step up, so much as the final step in the trade-off between random and fast. For instance, the Mersenne Twister algorithm is both fast and very random. (In fact, if you reference <a href="http://cs.gmu.edu/~sean/research/" rel="nofollow">http://cs.gmu.edu/~sean/research/</a>, the guy there claims it&#8217;s faster than Random.)</p>
<p>Incidentally, this &#8220;random isn&#8217;t&#8221; complaint is a common in C++ as well. Most default random number implementations are trash. Thus, I agree that the title &#8220;Sun Redefines Random&#8221; title is a bit uncharitable. Further, he&#8217;s picking on a pretty well-known issue with the underlying algorithm, so he&#8217;s not &#8220;groundbreaking&#8221; by any means. However, I think the solution he suggests has some merit, and this could be a place that Sun could improve on other languages.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
