SQLite: Simple Database With Encryption? (really confused) lazarus / 16-Databases ---------------------------------------------------------------------- kwanbis · 2010-03-26 21:59 I need a simple db that supports encryption. SQLite appears to be the best (i'm open so suggestions), so i'm trying to make it work. Sadly, documentation is a little bit confusing. I installed Lazarus 0.9.28.2.22279, and it cames with: 1) SQLdb (TSQLite3connections) 2) TSqlite3Dataset (i think so) Reading the instructions tells me to install /components/sqlite, there i can find sqlite3laz and sqlitelaz. Also, there are mentions to this SQLitePass and Sqlite3Wrapper. So, what do i need to use? I just need a date field, a text field, and a memo field, all encrypted. Thanks. EDIT: re-reading, it looks like SQLite does NOT support encryption? What dbs do? ---------------------------------------------------------------------- JD · 2010-03-27 00:00 Quote from: kwanbis on March 26, 2010, 10:59:42 pmEDIT: re-reading, it looks like SQLite does NOT support encryption? What dbs do? Yes it does, though you might need to buy the version that has encryption support. The only free SQLite DLL that has encryption support that I know of is the one bundled with the C++ GUI library wxWidgets' components The site http://wxcode.sourceforge.net/components/wxsqlite3/  states that QuotewxSQLite3 includes an optional extension for SQLite supporting key based database file encryption using 128 bit AES encryption. Starting with version 1.9.6 of wxSQLite3 the encryption extension is compatible with the SQLite amalgamation source.  Experimental support for 256 bit AES encryption has been added in version 1.9.8. You can download the component from http://sourceforge.net/projects/wxcode/files/Components/ I think the dll with encryption support is in the '..\sqlite3\secure' directory. All things being equal, just replace the plain vanilla sqlite dll with this encryption supported dll in the Lazarus directory & in your main project directory and that ought to do the trick. ---------------------------------------------------------------------- kwanbis · 2010-03-27 00:03 Thanks for the encryption info. What about what components to use? And, is there a better choice than SQLite, for a local encrypted db? ---------------------------------------------------------------------- JD · 2010-03-27 00:03 Quote from: kwanbis on March 26, 2010, 10:59:42 pmReading the instructions tells me to install /components/sqlite, there i can find sqlite3laz and sqlitelaz. Install ONLY sqlite3laz. This component supports sqlite3. Make sure you have copied the sqlite dll into your Lazarus directory BEFORE rebuilding Lazarus or else Lazarus will crash after rebuilding because it searches for the dll in the Lazarus executable's directory. ---------------------------------------------------------------------- kwanbis · 2010-03-27 00:13 Would try to use the special SQLite component. Is there a page that list supported dbs and capabilities? I would take a look at zeoslib. ---------------------------------------------------------------------- JD · 2010-03-27 00:13 If you install sqlite3laz, after installation, you'll find the SqLite3Dataset component on the Data Access tab. I actually use the ZeosLib because it is can handle many different databases - from sqlite to oracle! All one needs to do is to change the 'protocol' - data driver dll - to access another database. Your source code remains unchanged for the most part. I would definitely recommend Zeos but then I'm not impartial. QuoteIs there a page that list supported dbs and capabilities? http://en.wikipedia.org/wiki/Comparison_of_relational_database_managem ent_systems ---------------------------------------------------------------------- kwanbis · 2010-03-27 00:19 Yes, thanks. It's been so long since i have done any (delphi) db programming! ---------------------------------------------------------------------- JD · 2010-03-27 00:24 Quote from: kwanbis on March 27, 2010, 01:19:09 amYes, thanks. It's been so long since i have done any (delphi) db programming! That's fine because using Zeos is very similar to using Delphi TTable, TDataset etc For example, this page might come in handy as a refresher course http://www.podgoretsky.pri.ee/ftp/Docs/Delphi/D5/dg/5_datset.html ---------------------------------------------------------------------- JD · 2010-03-27 08:01 Quote from: kwanbis on March 27, 2010, 01:13:05 amI would take a look at zeoslib. By the way, you'll find the Zeos portal at http://zeos.firmos.at/ . They have a very active user forum there too. ---------------------------------------------------------------------- cody · 2010-05-16 14:12 Please some explanation: QuoteYou can download the component from http://sourceforge.net/projects/wxcode/files/Components/ I think the dll with encryption support is in the '..\sqlite3\secure' directory. All things being equal, just replace the plain vanilla sqlite dll with this encryption supported dll in the Lazarus directory & in your main project directory and that ought to do the trick. How do I actually invoke/control the encryption with TSqlite3Dataset, or is there some other way? Thanks ---------------------------------------------------------------------- Enzo · 2010-05-22 04:21 Quote from: cody on May 16, 2010, 04:12:54 pm How do I actually invoke/control the encryption with TSqlite3Dataset, or is there some other way? Thanks Yes, how? ---------------------------------------------------------------------- krexon · 2010-05-22 06:36 Take a look at SQLCipher (http://www.zetetic.net/software/sqlcipher) - open source transparent SQLite AES-256 encryption.