<?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>Alexander Jäger&#187; key stream</title>
	<atom:link href="http://www.alexanderjaeger.de/tag/key-stream/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexanderjaeger.de</link>
	<description>Alex Jäger</description>
	<lastBuildDate>Mon, 30 Jan 2012 18:36:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>iPhone random number arc4random</title>
		<link>http://www.alexanderjaeger.de/iphone-random-number-arc4random/</link>
		<comments>http://www.alexanderjaeger.de/iphone-random-number-arc4random/#comments</comments>
		<pubDate>Tue, 26 May 2009 08:08:48 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[arc4]]></category>
		<category><![CDATA[bers]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[cipher]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[genutzt]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[key stream]]></category>
		<category><![CDATA[nicht]]></category>
		<category><![CDATA[pseudo random]]></category>
		<category><![CDATA[random number]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[stream generator]]></category>

		<guid isPermaLink="false">http://www.alexanderjaeger.de/?p=552</guid>
		<description><![CDATA[Eine zufällige Zahl auf dem iPhone zu erzeugen kann bei upload Anwendungen sinnvoll sein um keine vorhandenen Daten zu überschreiben. Statt der random() Methode sollte besser arc4random() genutzt werden. Auszug The arc4random() function uses the key stream generator employed by the arc4 cipher, which uses 8*8 8 bit S-Boxes. The S-Boxes can be in about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alexanderjaeger.de/wp-content/uploads/2009/05/arc4randomexample.png"><img class="aligncenter size-medium wp-image-555" title="arc4randomexample" src="http://www.alexanderjaeger.de/wp-content/uploads/2009/05/arc4randomexample-300x24.png" alt="arc4randomexample" width="300" height="24" /></a></p>
<p>Eine <strong>zufällige</strong> Zahl auf dem iPhone zu erzeugen kann bei upload Anwendungen sinnvoll sein um keine vorhandenen Daten zu überschreiben. Statt der <strong>random()</strong> Methode sollte besser <strong>arc4random() </strong>genutzt werden.</p>
<p><a href="http://developer.apple.com/iphone/library/documentation/system/conceptual/manpages_iphoneos/man3/arc4random.3.html" target="_blank">Auszug</a></p>
<blockquote>
<pre class="manpages"><tt><tt>The <strong>arc4random</strong>() function uses the key stream generator employed by the
     arc4 cipher, which uses 8*8 8 bit S-Boxes.  The S-Boxes can be in about
     (2**1700) states.  The <strong>arc4random</strong>() function returns pseudo-random num-<span class="whiteout" style="color: #ffffff;">bers numbers</span>
     bers in the range of 0 to (2**32)-1, and therefore has twice the range of
     <a href="http://developer.apple.com/iphone/library/documentation/system/conceptual/manpages_iphoneos/man3/rand.3.html#//apple_ref/doc/man/3/rand">rand(3)</a> and <a href="http://developer.apple.com/iphone/library/documentation/system/conceptual/manpages_iphoneos/man3/random.3.html#//apple_ref/doc/man/3/random">random(3)</a>.

     The <strong>arc4random_stir</strong>() function reads data from <span style="text-decoration: underline;">/dev/urandom</span> and uses it
     to permute the S-Boxes via <strong>arc4random_addrandom</strong>().

     There is no need to call <strong>arc4random_stir</strong>() before using <strong>arc4random</strong>(),
     since <strong>arc4random</strong>() automatically initializes itself.

</tt></tt></pre>
</blockquote>
<p>Random() erzeugt bei jedem Aufruf die gleiche Abfolge von Zufallszahlen und ist daher NICHT für diesen Zweck zu gebrauchen.</p>
<p>Zum Abschluss noch ein kleines Codebeispiel zu arc4random();</p>
<blockquote><p>NSLog(@&#8221;Random Number&#8221;);<br />
NSString *foo =[NSString stringWithFormat:@"%d",arc4random()];<br />
NSLog(foo);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.alexanderjaeger.de/iphone-random-number-arc4random/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

