Open a Encrypted Sqlite DB

I encrypted a SQLITE db using Navigate Premium witch uses AES-128 encryption method but when I try to connect to this db I get an error message. What am I doing wrong?

The error code is number 26: #define SQLITE_NOTADB 26 /* File opened that is not a database file */

[i] db = New SQLiteDatabase
dbfile = GetFolderItem(“brechodemo.sqlite”)
app.db.DatabaseFile = dbfile

if not dbfile.Exists Then
MsgBox(“O arquivo no existe.”)
End if

app.db.EncryptionKey = “#########”

If app.db.Connect Then

app.db.Decrypt[/i]

I assume you mean Navicat Premium as I use the product also. You have to use the inbuilt encryption in Xojo, i.e. ‘encrypt in and decrypt in’. Encryption by other products of sqlite can only be opened in those products is my understanding. Build your DB in those products but leave the encrypt and decrypt to XOJO.

Paul

You are probably doing nothing wrong… However, this does NOT mean that the encyption method that XOJO uses and the encyption method Navigate Premium use are any where near compatible.

There are multiple ways to encrypt SQLite… both internal and external. The internal method encyrpts at the table/record level and is encrypted/decrypted as data is read and written. Another method would encrypt the entire file, requiring it to be decrypted as a whole before it could be read or written.

And even then the actual encryption algorithm used could be any number of things.

So, I would say for the most part, if XOJO didn’t encrypt it, then most likely XOJO can’t decrypt it…
NOTE : This is NOT 100% true… there are compatible software

Thanks!