Recent

Author Topic: SQLite: Simple Database With Encryption? (really confused)  (Read 22946 times)

kwanbis

  • New Member
  • *
  • Posts: 14
SQLite: Simple Database With Encryption? (really confused)
« on: March 26, 2010, 10:59:42 pm »
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?
« Last Edit: March 26, 2010, 11:32:36 pm by kwanbis »

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #1 on: March 27, 2010, 01:00:02 am »
EDIT: 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
Quote
wxSQLite3 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.  :D
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

kwanbis

  • New Member
  • *
  • Posts: 14
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #2 on: March 27, 2010, 01:03:02 am »
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

  • Hero Member
  • *****
  • Posts: 1848
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #3 on: March 27, 2010, 01:03:38 am »
Reading 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.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

kwanbis

  • New Member
  • *
  • Posts: 14
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #4 on: March 27, 2010, 01:13:05 am »
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

  • Hero Member
  • *****
  • Posts: 1848
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #5 on: March 27, 2010, 01:13:21 am »
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.  :D

Quote
Is there a page that list supported dbs and capabilities?

http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems
« Last Edit: March 27, 2010, 01:20:44 am by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

kwanbis

  • New Member
  • *
  • Posts: 14
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #6 on: March 27, 2010, 01:19:09 am »
Yes, thanks. It's been so long since i have done any (delphi) db programming!

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #7 on: March 27, 2010, 01:24:20 am »
Yes, 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
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #8 on: March 27, 2010, 09:01:31 am »
I 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.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

cody

  • New member
  • *
  • Posts: 9
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #9 on: May 16, 2010, 04:12:54 pm »
Please some explanation:
Quote
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.

How do I actually invoke/control the encryption with TSqlite3Dataset, or is there some other way?

Thanks

Enzo

  • Newbie
  • Posts: 2
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #10 on: May 22, 2010, 06:21:02 am »

How do I actually invoke/control the encryption with TSqlite3Dataset, or is there some other way?

Thanks

Yes, how?

krexon

  • Jr. Member
  • **
  • Posts: 80
Re: SQLite: Simple Database With Encryption? (really confused)
« Reply #11 on: May 22, 2010, 08:36:42 am »
Take a look at SQLCipher (http://www.zetetic.net/software/sqlcipher) - open source transparent SQLite AES-256 encryption.

 

TinyPortal © 2005-2018