<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: AIR 1.5 encrypted SQLite database &#8212; how to use it, best practices, and new projects</title>
	<atom:link href="http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/</link>
	<description>Thoughts on web development, user-centered design, code, etc. by Paul Robertson</description>
	<lastBuildDate>Wed, 16 May 2012 17:16:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Paul</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-76546</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sat, 24 Jul 2010 01:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-76546</guid>
		<description>Hi Amit,
If you&#039;ve encrypted the database using an encryption key created with the EncryptionKeyGenerator class, you can only open it if you know the encryption key that was used to encrypt it. For Lita (and for Run!) you need to enter the Base64-encoded encryption key when you&#039;re opening the database. (So you&#039;ll need to not only know the encryption key, but you&#039;ll have to Base64-encode it.) If you didn&#039;t capture the encryption key when it was being created, you&#039;ll have to capture it (when it&#039;s re-created by your app using the EncryptionKeyGenerator class). To do that you&#039;ll need to add some code in your app to take the generated encryption key, Base64-encode it (for example, using the Base64Encoder class in Flex), then print it using trace() or capture it in some way like that.</description>
		<content:encoded><![CDATA[<p>Hi Amit,<br />
If you&#8217;ve encrypted the database using an encryption key created with the EncryptionKeyGenerator class, you can only open it if you know the encryption key that was used to encrypt it. For Lita (and for Run!) you need to enter the Base64-encoded encryption key when you&#8217;re opening the database. (So you&#8217;ll need to not only know the encryption key, but you&#8217;ll have to Base64-encode it.) If you didn&#8217;t capture the encryption key when it was being created, you&#8217;ll have to capture it (when it&#8217;s re-created by your app using the EncryptionKeyGenerator class). To do that you&#8217;ll need to add some code in your app to take the generated encryption key, Base64-encode it (for example, using the Base64Encoder class in Flex), then print it using trace() or capture it in some way like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-76540</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Fri, 23 Jul 2010 13:52:02 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-76540</guid>
		<description>How can i open my encrypted database into Lita or any other tool , like sqlite expert professional 
i can&#039;t able to open ,, i am using the EncryptionKeyGenerator  Class for that Any helo would be fine foe me :((</description>
		<content:encoded><![CDATA[<p>How can i open my encrypted database into Lita or any other tool , like sqlite expert professional<br />
i can&#8217;t able to open ,, i am using the EncryptionKeyGenerator  Class for that Any helo would be fine foe me :((</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-73664</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 02 Mar 2010 04:14:51 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-73664</guid>
		<description>I have reviewed the documentation for the EncryptionKeyGenerator class on the Adobe site.  Would you agree that there is no way to open an encrypted database on a computer other than the one on which the database was created?  It seems that since the salt is stored in the ELS, the database is married to the machine.  My application utilizes a sqlite database that I want encrypted but which can be moved freely to and from any machine and opened by any machine that has my application installed.  I would expect a password to be provided every time the application opens the database.

It seems that if one uses the EncryptionKeyGenerator to encrypt a database and then the hard drive crashes, that database is useless even if it is backed up because the ELS will be lost.</description>
		<content:encoded><![CDATA[<p>I have reviewed the documentation for the EncryptionKeyGenerator class on the Adobe site.  Would you agree that there is no way to open an encrypted database on a computer other than the one on which the database was created?  It seems that since the salt is stored in the ELS, the database is married to the machine.  My application utilizes a sqlite database that I want encrypted but which can be moved freely to and from any machine and opened by any machine that has my application installed.  I would expect a password to be provided every time the application opens the database.</p>
<p>It seems that if one uses the EncryptionKeyGenerator to encrypt a database and then the hard drive crashes, that database is useless even if it is backed up because the ELS will be lost.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lisa B</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-58211</link>
		<dc:creator>Lisa B</dc:creator>
		<pubDate>Fri, 27 Mar 2009 15:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-58211</guid>
		<description>I should always read the most recent posts prior to commenting.  I just found your work on Lita and this does exactly what I need.  A good tool too.  Thanks!</description>
		<content:encoded><![CDATA[<p>I should always read the most recent posts prior to commenting.  I just found your work on Lita and this does exactly what I need.  A good tool too.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lisa B</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-58209</link>
		<dc:creator>Lisa B</dc:creator>
		<pubDate>Fri, 27 Mar 2009 15:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-58209</guid>
		<description>I&#039;m interested in distributing a prepopulated SQLite database with my application (and actually creating it on the fly via ColdFusion and the SQLite ODBC drivers).  Do you have any recommendations for tools to create encrypted databases (outside of your AIR code) that an AIR application can read?
Thanks for your help, tools and articles.  They have definitely been helpful in the past (and I&#039;m sure in the future).

Lisa</description>
		<content:encoded><![CDATA[<p>I&#8217;m interested in distributing a prepopulated SQLite database with my application (and actually creating it on the fly via ColdFusion and the SQLite ODBC drivers).  Do you have any recommendations for tools to create encrypted databases (outside of your AIR code) that an AIR application can read?<br />
Thanks for your help, tools and articles.  They have definitely been helpful in the past (and I&#8217;m sure in the future).</p>
<p>Lisa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-55245</link>
		<dc:creator>George</dc:creator>
		<pubDate>Thu, 22 Jan 2009 21:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-55245</guid>
		<description>Hi Paul,

I&#039;m using your key generator class only modify salt, I tried to open the database with your Doppler, paste the hashed key, but nothing happened. Did I miss something?

var hashedKey:String = SHA256.hashBytes(unhashedKey);
trace(&#039;key:&#039;+ hashedKey);
var encryptionKey:ByteArray = generateEncryptionKey(hashedKey);

Thanks for your great work,
George</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>I&#8217;m using your key generator class only modify salt, I tried to open the database with your Doppler, paste the hashed key, but nothing happened. Did I miss something?</p>
<p>var hashedKey:String = SHA256.hashBytes(unhashedKey);<br />
trace(&#8216;key:&#8217;+ hashedKey);<br />
var encryptionKey:ByteArray = generateEncryptionKey(hashedKey);</p>
<p>Thanks for your great work,<br />
George</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robertson</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-55034</link>
		<dc:creator>Paul Robertson</dc:creator>
		<pubDate>Fri, 16 Jan 2009 19:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-55034</guid>
		<description>Hi Abhishek,
Usually a server database includes two parts (both of which live on the server): the database engine, which processes all SQL statements etc., and the actual data storage on disk. SQLite also uses these two parts (database engine and data), but they are more explicitly separate. The database engine is designed as a library that can be included in various applications. The actual data is stored in files on the filesystem, wherever you choose to place those files. They are often on a local disk such as a hard drive. Theoretically they could be on a network drive that&#039;s mounted like a local drive, although that&#039;s not recommended for performance and stability reasons.

In the case of AIR, the AIR runtime includes the SQLite engine. Within your AIR application you can choose a location for the database file, and the data is stored there. So in general if you want an app to access a local data store rather than a server data store, SQLite is a good choice.

You could theoretically have a database file precreated, with the data prepopulated, and burn that database file onto a CD. You could then access the database file on the CD from your AIR application. However, the potential complications I see are:

- An AIR application can&#039;t be run from a CD -- it must be installed on the user&#039;s machine. So even though the data would be on the CD, the application would have to be installed. Because of that, it seems somewhat pointless to keep the data on the CD rather than the local machine, unless you have another reason for doing so. (The only thing I can think of is you could use it as a weak form of copy protection -- i.e. the user would have to have the CD in order to run the app).

- The AIR application would have to figure out the drive name of the CD drive, so that it could find the database file, since drive name mappings can vary between machines, and even on the same machine at different times

- The database file would have to be opened in read-only mode. Usually the database engine writes a temporary file in the same directory as the database file, and obviously that wouldn&#039;t work for a CD. I&#039;m guessing that if you open the database in read-only mode, then the database wouldn&#039;t attempt to create that temporary file, but I could be wrong in which case it probably wouldn&#039;t work at all.

As far as how to use the AIR SQLite functionality in a JavaScript-based AIR application, you&#039;ll probably want to start here:
&lt;a href=&quot;http://www.adobe.com/devnet/air/ajax/quickstart/simple_sql_database.html&quot; rel=&quot;nofollow&quot;&gt;Working asynchronously with a local SQL database&lt;/a&gt;
&lt;a href=&quot;http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html&quot; rel=&quot;nofollow&quot;&gt;Working with local SQL databases&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi Abhishek,<br />
Usually a server database includes two parts (both of which live on the server): the database engine, which processes all SQL statements etc., and the actual data storage on disk. SQLite also uses these two parts (database engine and data), but they are more explicitly separate. The database engine is designed as a library that can be included in various applications. The actual data is stored in files on the filesystem, wherever you choose to place those files. They are often on a local disk such as a hard drive. Theoretically they could be on a network drive that&#8217;s mounted like a local drive, although that&#8217;s not recommended for performance and stability reasons.</p>
<p>In the case of AIR, the AIR runtime includes the SQLite engine. Within your AIR application you can choose a location for the database file, and the data is stored there. So in general if you want an app to access a local data store rather than a server data store, SQLite is a good choice.</p>
<p>You could theoretically have a database file precreated, with the data prepopulated, and burn that database file onto a CD. You could then access the database file on the CD from your AIR application. However, the potential complications I see are:</p>
<p>- An AIR application can&#8217;t be run from a CD &#8212; it must be installed on the user&#8217;s machine. So even though the data would be on the CD, the application would have to be installed. Because of that, it seems somewhat pointless to keep the data on the CD rather than the local machine, unless you have another reason for doing so. (The only thing I can think of is you could use it as a weak form of copy protection &#8212; i.e. the user would have to have the CD in order to run the app).</p>
<p>- The AIR application would have to figure out the drive name of the CD drive, so that it could find the database file, since drive name mappings can vary between machines, and even on the same machine at different times</p>
<p>- The database file would have to be opened in read-only mode. Usually the database engine writes a temporary file in the same directory as the database file, and obviously that wouldn&#8217;t work for a CD. I&#8217;m guessing that if you open the database in read-only mode, then the database wouldn&#8217;t attempt to create that temporary file, but I could be wrong in which case it probably wouldn&#8217;t work at all.</p>
<p>As far as how to use the AIR SQLite functionality in a JavaScript-based AIR application, you&#8217;ll probably want to start here:<br />
<a href="http://www.adobe.com/devnet/air/ajax/quickstart/simple_sql_database.html" rel="nofollow">Working asynchronously with a local SQL database</a><br />
<a href="http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html" rel="nofollow">Working with local SQL databases</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek Sawant</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-55023</link>
		<dc:creator>Abhishek Sawant</dc:creator>
		<pubDate>Fri, 16 Jan 2009 06:47:34 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-55023</guid>
		<description>hello sir
i want to use SQLite in the situation in which data wont be on any server it would be stored on cd and there wont be any server on client side as client would be accessing data directly thr cd 
so in this scenario it will be beneficial to use AIR sqlite or i use sqlite3 and how should i use thr javascript pls reply its urgent.</description>
		<content:encoded><![CDATA[<p>hello sir<br />
i want to use SQLite in the situation in which data wont be on any server it would be stored on cd and there wont be any server on client side as client would be accessing data directly thr cd<br />
so in this scenario it will be beneficial to use AIR sqlite or i use sqlite3 and how should i use thr javascript pls reply its urgent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish Mahajan</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-53634</link>
		<dc:creator>Ashish Mahajan</dc:creator>
		<pubDate>Thu, 11 Dec 2008 14:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-53634</guid>
		<description>I have two issues I am still facing
(A)  What tool will I be able to manage structure and content of a encrypted database?
(B)  I am getting error from openSync method of SQLConnection that it only supports five arguments?</description>
		<content:encoded><![CDATA[<p>I have two issues I am still facing<br />
(A)  What tool will I be able to manage structure and content of a encrypted database?<br />
(B)  I am getting error from openSync method of SQLConnection that it only supports five arguments?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JJ</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-53423</link>
		<dc:creator>JJ</dc:creator>
		<pubDate>Thu, 04 Dec 2008 13:21:07 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-53423</guid>
		<description>After doing a lot of research about this issue and sleeping on it, I&#039;m coming to the conclusion that it is almost impossible to completely hide a password (even with the encrypted file store class).  Decompiling seems to be always able to unravel the code and figure out the encoding.  There is that very strong mode of file store encryption that is tied to the application that created it, but then you can&#039;t update your AIR app because the decryption will fail.

Am I missing something?  Is the only way around all of this to encrypt the SWF with one of the commercial encrypters?  Even those can be gotten around but I can make that pretty difficult to uncover.

Are there any other ideas for really protecting the assets in a database?</description>
		<content:encoded><![CDATA[<p>After doing a lot of research about this issue and sleeping on it, I&#8217;m coming to the conclusion that it is almost impossible to completely hide a password (even with the encrypted file store class).  Decompiling seems to be always able to unravel the code and figure out the encoding.  There is that very strong mode of file store encryption that is tied to the application that created it, but then you can&#8217;t update your AIR app because the decryption will fail.</p>
<p>Am I missing something?  Is the only way around all of this to encrypt the SWF with one of the commercial encrypters?  Even those can be gotten around but I can make that pretty difficult to uncover.</p>
<p>Are there any other ideas for really protecting the assets in a database?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JJ</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-53408</link>
		<dc:creator>JJ</dc:creator>
		<pubDate>Wed, 03 Dec 2008 21:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-53408</guid>
		<description>Really good info, Paul.  It gave me a good background for something that we need in an application we&#039;re currently writing.

I&#039;m wondering if you can comment on a slightly different need that we have.  We&#039;re using the encrypted capabilities of AIR/SQLite to hold proprietary data from our server for offline use by our customers.  That&#039;s one of the huge advantages to AIR/encrypted SQLite - we can now give the user the option of running online and connected to our server, or offline (with our data on their desktop - allowing for synchonization issues, etc).

Anyway, the encryption key that we need to use can&#039;t be based on a user&#039;s password because we only want them having access to the database through our AIR application - even if the key is further encrypted.  What would stop someone from decompiling the SWF to uncover the mechanism or our own stored password?  How can we protect our data that is local in the database?

If I didn&#039;t describe this well, please let me know and I&#039;ll come up with another example of the problem.</description>
		<content:encoded><![CDATA[<p>Really good info, Paul.  It gave me a good background for something that we need in an application we&#8217;re currently writing.</p>
<p>I&#8217;m wondering if you can comment on a slightly different need that we have.  We&#8217;re using the encrypted capabilities of AIR/SQLite to hold proprietary data from our server for offline use by our customers.  That&#8217;s one of the huge advantages to AIR/encrypted SQLite - we can now give the user the option of running online and connected to our server, or offline (with our data on their desktop - allowing for synchonization issues, etc).</p>
<p>Anyway, the encryption key that we need to use can&#8217;t be based on a user&#8217;s password because we only want them having access to the database through our AIR application - even if the key is further encrypted.  What would stop someone from decompiling the SWF to uncover the mechanism or our own stored password?  How can we protect our data that is local in the database?</p>
<p>If I didn&#8217;t describe this well, please let me know and I&#8217;ll come up with another example of the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robertson</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-53133</link>
		<dc:creator>Paul Robertson</dc:creator>
		<pubDate>Mon, 24 Nov 2008 17:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-53133</guid>
		<description>Hi David,
Sorry about the confusion. You&#039;re right that the current download .zip (.92.1) doesn&#039;t include the encryption key generator class. The .zip hasn&#039;t been updated yet with the newest changes. (All the project owners were at MAX last week when I posted the new content.)

I&#039;ll ping them to see if any of them can rebuild the .zip file. In the mean time, the class is available in the source, if you &lt;a href=&quot;http://code.google.com/p/as3corelib/source/browse/trunk/src/com/adobe/air/crypto/EncryptionKeyGenerator.as&quot; rel=&quot;nofollow&quot;&gt;browse on the project web site&lt;/a&gt; or check it out via SVN.

Paul</description>
		<content:encoded><![CDATA[<p>Hi David,<br />
Sorry about the confusion. You&#8217;re right that the current download .zip (.92.1) doesn&#8217;t include the encryption key generator class. The .zip hasn&#8217;t been updated yet with the newest changes. (All the project owners were at MAX last week when I posted the new content.)</p>
<p>I&#8217;ll ping them to see if any of them can rebuild the .zip file. In the mean time, the class is available in the source, if you <a href="http://code.google.com/p/as3corelib/source/browse/trunk/src/com/adobe/air/crypto/EncryptionKeyGenerator.as" rel="nofollow">browse on the project web site</a> or check it out via SVN.</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davidderaedt</title>
		<link>http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/#comment-53120</link>
		<dc:creator>davidderaedt</dc:creator>
		<pubDate>Mon, 24 Nov 2008 10:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://probertson.com/?p=214#comment-53120</guid>
		<description>Hi Paul,

Did you mean that your encryption class will be included in future releases of the core lib? Because, as far as I know, build .92.1 (latest build to date) does not include it.</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>Did you mean that your encryption class will be included in future releases of the core lib? Because, as far as I know, build .92.1 (latest build to date) does not include it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

