<?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>digitaldogbyte.com &#187; Adobe AIR</title>
	<atom:link href="http://www.digitaldogbyte.com/category/adobe-air/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digitaldogbyte.com</link>
	<description>powered by kilobits n' bytes</description>
	<lastBuildDate>Sat, 16 Jul 2011 03:01:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>AIR Time Tracking Application &#8211; harvestcoop</title>
		<link>http://www.digitaldogbyte.com/2009/02/24/air-time-tracking-application-harvestcoop/</link>
		<comments>http://www.digitaldogbyte.com/2009/02/24/air-time-tracking-application-harvestcoop/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 04:00:39 +0000</pubDate>
		<dc:creator>Herm Wong</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[harvestcoop]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[time tracking]]></category>

		<guid isPermaLink="false">http://www.digitaldogbyte.com/2009/02/24/air-time-tracking-application-harvestcoop/</guid>
		<description><![CDATA[I&#8217;ve recently written an AIR time tracking application that uses the Harvest &#38; Coopapp APIs. The code and AIR application can be found on the harvestcoop project page on Google Code. Harvest does provide an iPhone application and also a Harvest Widget for Mac OS X &#38; MS Vista. I decided to create an AIR [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently written an AIR time tracking application that uses the <a href="http://www.getharvest.com/" title="Harvest - Simple Online Time Tracking" target="_blank">Harvest</a> &amp; <a href="http://www.coopapp.com/" title="Co-op App" target="_blank">Coopapp</a> APIs. The code and AIR application can be found on the <a href="http://code.google.com/p/harvestcoop/" title="harvestcoop - Google Code" target="_blank">harvestcoop</a> project page on Google Code.</p>
<p>Harvest does provide an iPhone application and also a Harvest Widget for Mac OS X &amp; MS Vista. I decided to create an AIR application so that users on operating systems that don&#8217;t have widget support can do their time tracking from the comfort of their own desktops.</p>
<p>The harvestcoop AIR application currently works with Harvest accounts that have widget support.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitaldogbyte.com/2009/02/24/air-time-tracking-application-harvestcoop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQLite Encryption in AIR 1.5</title>
		<link>http://www.digitaldogbyte.com/2009/02/10/sqlite-encryption-in-air-15/</link>
		<comments>http://www.digitaldogbyte.com/2009/02/10/sqlite-encryption-in-air-15/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 03:28:44 +0000</pubDate>
		<dc:creator>Herm Wong</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://www.digitaldogbyte.com/?p=9</guid>
		<description><![CDATA[The Adobe AIR runtime includes a SQLite database so that you can create data driven applications. The following are the default locations for the SQLite database: Mac OS X: /Users/&#60;userName&#62;/Library/Preferences/&#60;applicationName&#62;/Local Store/&#60;databaseFileName&#62;.db Windows: C:\Documents and Settings\&#60;userName&#62;\Application Data\&#60;applicationName&#62;\Local Store\&#60;databaseFileName&#62;.db Adobe AIR 1.5 introduces a feature to encrypt the SQLite database so that you can secure the contents [...]]]></description>
			<content:encoded><![CDATA[<p>The Adobe AIR runtime includes a <a href="http://www.sqlite.org/index.html" title="sqlite.org" target="_blank">SQLite</a> database so that you can create data driven applications.</p>
<p>The following are the default locations for the SQLite database:</p>
<p>Mac OS X:</p>
<p>/Users/&lt;userName&gt;/Library/Preferences/&lt;applicationName&gt;/Local Store/&lt;databaseFileName&gt;.db</p>
<p>Windows:</p>
<p>C:\Documents and Settings\&lt;userName&gt;\Application Data\&lt;applicationName&gt;\Local Store\&lt;databaseFileName&gt;.db</p>
<p>Adobe AIR 1.5 introduces a feature to encrypt the SQLite database so that you can secure the contents of database. This is could come in handy if you are writing an application that stores information such as customer contact data.</p>
<p>The <a href="http://livedocs.adobe.com/flex/3/langref/flash/data/SQLConnection.html#open()" title="Open Method" target="_blank">Open</a> method and the <a href="http://livedocs.adobe.com/flex/3/langref/flash/data/SQLConnection.html#openAsync()" title="OpenAsync Method" target="_blank">OpenAsync</a> method of the <a href="http://livedocs.adobe.com/flex/3/langref/flash/data/SQLConnection.html" title="SQLConnection Class" target="_blank">SQLConnection</a> class include an encryptionKey parameter; this parameter tells AIR to encrypt the database file.</p>
<p>The code sample below shows you how to create / open an encrypted SQLite database. Links to an example application &amp; code can be found at the end of this article.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>digitaldogbyte<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>Encryption<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dbConn<span style="color: #000066; font-weight: bold;">:</span>SQLConnection<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dbFile<span style="color: #000066; font-weight: bold;">:</span>File<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dbKey<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	dbKey = Encryption<span style="color: #000066; font-weight: bold;">.</span>retrieveKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	dbFile = File<span style="color: #000066; font-weight: bold;">.</span>applicationStorageDirectory<span style="color: #000066; font-weight: bold;">.</span>resolvePath<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;EncryptionExample.db&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	dbFile<span style="color: #000066; font-weight: bold;">.</span>createDirectory<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	dbConn = <span style="color: #0033ff; font-weight: bold;">new</span> SQLConnection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	dbConn<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SQLEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">OPEN</span><span style="color: #000066; font-weight: bold;">,</span> handleDbOpen<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	dbConn<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SQLErrorEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ERROR</span><span style="color: #000066; font-weight: bold;">,</span> handleDbError<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// by passing in the dbKey variable as the encryptionKey parameter we are telling AIR to encrypt the SQLite database</span>
	dbConn<span style="color: #000066; font-weight: bold;">.</span>openAsync<span style="color: #000000;">&#40;</span>dbFile<span style="color: #000066; font-weight: bold;">,</span> SQLMode<span style="color: #000066; font-weight: bold;">.</span>CREATE<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1024</span><span style="color: #000066; font-weight: bold;">,</span> dbKey<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Let&#8217;s take a look at the Encryption class to see how the dbKey ByteArray is created. The dbKey value is assigned the return value of the retrieveKey method from the Encryption class. The retrieveKey method checks to see if a key already exists in the application&#8217;s EncryptedLocalStore. If the key already exists the retrieveKey method will return the existing key, however if the key does not exist; the generateKey method is called to create a key.</p>
<p>The generateKey method uses the <a href="http://code.google.com/p/as3crypto/" title="as3crypto library" target="_blank">as3crypto</a> library&#8217;s Random type to create a key. This key is required to read &amp; write to the encrypted database.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>digitaldogbyte<span style="color: #000066; font-weight: bold;">.</span>util
<span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>crypto<span style="color: #000066; font-weight: bold;">.</span>Crypto<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>crypto<span style="color: #000066; font-weight: bold;">.</span>prng<span style="color: #000066; font-weight: bold;">.</span>Random<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>crypto<span style="color: #000066; font-weight: bold;">.</span>symmetric<span style="color: #000066; font-weight: bold;">.</span>AESKey<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>crypto<span style="color: #000066; font-weight: bold;">.</span>symmetric<span style="color: #000066; font-weight: bold;">.</span>ECBMode<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>crypto<span style="color: #000066; font-weight: bold;">.</span>symmetric<span style="color: #000066; font-weight: bold;">.</span>ICipher<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>hurlant<span style="color: #000066; font-weight: bold;">.</span>util<span style="color: #000066; font-weight: bold;">.</span>Hex<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> flash<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>EncryptedLocalStore<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ByteArray</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Encryption
	<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> _key<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> generateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900; font-style: italic;">// create key - write to encrypted local store</span>
			_key = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ByteArray</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">random</span><span style="color: #000066; font-weight: bold;">:</span>Random = <span style="color: #0033ff; font-weight: bold;">new</span> Random<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">random</span><span style="color: #000066; font-weight: bold;">.</span>nextBytes<span style="color: #000000;">&#40;</span>_key<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">16</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			flash<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>EncryptedLocalStore<span style="color: #000066; font-weight: bold;">.</span>setItem<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;key&quot;</span><span style="color: #000066; font-weight: bold;">,</span>_key<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> retrieveKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900; font-style: italic;">// try to retrieve key from encrypted local store</span>
			_key = flash<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>EncryptedLocalStore<span style="color: #000066; font-weight: bold;">.</span>getItem<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;key&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #009900; font-style: italic;">// if no key found in encrypted local store - create a key</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_key == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				generateKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _key<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>After you&#8217;ve created the encrypted database you can navigate to the database file and try to open it. The database file will not open in your <a href="http://sqlitebrowser.sourceforge.net" target="_blank" title="SQLite Database Browser">database browser</a> application since the actual database file has been encrypted.</p>
<p><img src="http://www.digitaldogbyte.com/images/sqlite_encryption/sqlite_open_error.png" alt="SQLite open error" border="0" height="417" width="511" /></p>
<p>Here are the download links to the example <a href="http://www.digitaldogbyte.com/downloads/sqlite_encryption/SQLiteEncryption.air" title="SQLite Encryption Sample Application" target="_blank">application</a> &amp; <a href="http://www.digitaldogbyte.com/downloads/sqlite_encryption/SQLiteEncryption.zip" title="SQLite Encryption Sample Application Code" target="_blank">code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitaldogbyte.com/2009/02/10/sqlite-encryption-in-air-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypting Local Data with Adobe AIR</title>
		<link>http://www.digitaldogbyte.com/2009/01/17/encrypting-local-data-with-adobe-air/</link>
		<comments>http://www.digitaldogbyte.com/2009/01/17/encrypting-local-data-with-adobe-air/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 19:39:51 +0000</pubDate>
		<dc:creator>Herm Wong</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://www.digitaldogbyte.com/?p=8</guid>
		<description><![CDATA[The Adobe AIR 1.1 runtime provides built-in encryption for the local store. This feature can be used to secure sensitive information like usernames &#38; passwords for web services. The encrypted local store can be found at these locations on a user&#8217;s computer: Windows: C:\Documents and Settings\&#60;username&#62;\Application Data\Adobe\AIR\ELS\ Mac OS: /Users/&#60;username&#62;/Library/Application Support/Adobe/AIR/ELS/ To use the AIR&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The Adobe AIR 1.1 runtime provides built-in encryption for the local store.</p>
<p>This feature can be used to secure sensitive information like usernames &amp; passwords for web services.</p>
<p>The encrypted local store can be found at these locations on a user&#8217;s computer:</p>
<p>Windows: C:\Documents and Settings\&lt;username&gt;\Application Data\Adobe\AIR\ELS\</p>
<p>Mac OS: /Users/&lt;username&gt;/Library/Application Support/Adobe/AIR/ELS/</p>
<p>To use the AIR&#8217;s encrypted local store you will need to include the following packages:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> flash<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>EncryptedLocalStore<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ByteArray</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>The following code shows an example of encrypting a string and then storing it in the EncryptedLocalStore object. The strToEncrypt string needs to be converted into a ByteArray since the EncryptedLocalStore stores all of it&#8217;s data as a hash table that uses strings as keys and byte arrays for the data. In our example, we convert the strToEncrypt into a byteArray as the myByteArray variable using the ByteArray object&#8217;s writeUTFBytes method. We are now ready to save our data into the EncryptedLocalStore, which is done by using the EncryptedLocalStore&#8217;s setItem method. The setItem method takes a string parameter that it uses as the key for the hash table and then a byte array as the data that it needs to store.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> strToEncrypt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;Herman&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> myByteArray<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ByteArray</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
myByteArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">writeUTFBytes</span><span style="color: #000000;">&#40;</span>strToEncrypt<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
EncryptedLocalStore<span style="color: #000066; font-weight: bold;">.</span>setItem<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;firstName&quot;</span><span style="color: #000066; font-weight: bold;">,</span> myByteArray<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>To retrieve the encrypted data from the EncryptedLocaStore you will need to use the getItem method and the string key for the data that you want to retrieve from the hash table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> storedValue<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = EncryptedLocalStore<span style="color: #000066; font-weight: bold;">.</span>getItem<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;firstName&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// get the string from the storedValue byte array and store in the strDecrypted variable</span>
<span style="color: #6699cc; font-weight: bold;">var</span> strDecrypted<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = storedValue<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">readUTFBytes</span><span style="color: #000000;">&#40;</span>storedValue<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>strDecrypted<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// &quot;Herman&quot;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// read the string from the storedValue byte array</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>storedValue<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">readUTFBytes</span><span style="color: #000000;">&#40;</span>storedValue<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// &quot;Herman&quot;</span></pre></td></tr></table></div>

<p>More documentation can on the EncryptedLocalStore class can be found on <a href="http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e31.html" target="_blank">Adobe&#8217;s site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitaldogbyte.com/2009/01/17/encrypting-local-data-with-adobe-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

