encrypt sqlite

Just starting out? Need help? Post your questions and find answers here.
boyoss
User
User
Posts: 74
Joined: Fri Feb 05, 2016 10:11 am

encrypt sqlite

Post by boyoss »

hello
is it possible to encrypt a database sqlite, and to connect to it with

Code: Select all

OpenDatabase(0, "db.sqlite", "name", "pass")
acreis
Enthusiast
Enthusiast
Posts: 182
Joined: Fri Jun 01, 2012 12:20 am

Re: encrypt sqlite

Post by acreis »

No.
boyoss
User
User
Posts: 74
Joined: Fri Feb 05, 2016 10:11 am

Re: encrypt sqlite

Post by boyoss »

thanks
maybe there is another solution, i don't want anybody can open my db, and i also don't want to use a server...
:?: :?: :?:
juror
Enthusiast
Enthusiast
Posts: 228
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: encrypt sqlite

Post by juror »

There's an encryption add-on via the sqlite organization which is quite expensive (thousands)

Most of the rest of us just encrypt the sqlite data ourselves, which isn't that much work utilizing PB's cipher tools.
boyoss
User
User
Posts: 74
Joined: Fri Feb 05, 2016 10:11 am

Re: encrypt sqlite

Post by boyoss »

much thanks
User avatar
doctorized
Addict
Addict
Posts: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: encrypt sqlite

Post by doctorized »

Sorry for bringing back to life this old thread. I managed to create a sqlite db with the sample code PB gives. Then, with the latest version of SQLiteManager, I added a password to the db. Every time I run SQLiteManager, the password is requested to acess the db but PB cannot access the db. OpenDatabase() seems to access the db regardless if I give the password as parameter or not but no result is returned in both cases. So, is there a way to access the db from PB?
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: encrypt sqlite

Post by kpeters58 »

No! Don’t mistake Sqlabs’ proprietary encryption for anything ‘official’ - the old statements are still true: There is no affordable, widespread dB encryption for SQLite. As per PB documentation, the username and password parameters are simply ignored.
PB 5.73 on Windows 10 & OS X High Sierra
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: encrypt sqlite

Post by the.weavster »

Isn't this what you want?
User avatar
doctorized
Addict
Addict
Posts: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: encrypt sqlite

Post by doctorized »

the.weavster wrote:Isn't this what you want?
Currently, I am using PB 5.62 and this version does not accept custom library. I will wait for 5.71 stable to check it out.
User avatar
Derren
Enthusiast
Enthusiast
Posts: 313
Joined: Sat Jul 23, 2011 1:13 am
Location: Germany

Re: encrypt sqlite

Post by Derren »

Can you load the whole Database, query * over all tables and decrypt every single column with any algorithm you want?
It would probably take some time, but if you want encryption, it's expected (unless it takes ages).
You work with this decrypted Database in memory and at the end, you encrypt everything and put it back into a file.
Downside: Ending the program also takes some time, which is frowned upon.
User avatar
doctorized
Addict
Addict
Posts: 856
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: encrypt sqlite

Post by doctorized »

Derren wrote:Can you load the whole Database, query * over all tables and decrypt every single column with any algorithm you want?
It would probably take some time, but if you want encryption, it's expected (unless it takes ages).
You work with this decrypted Database in memory and at the end, you encrypt everything and put it back into a file.
Downside: Ending the program also takes some time, which is frowned upon.
Most important downside: what happens when suddenly ac power gets off and your desktop pc closes? Every write operation is lost. The best way is to write/read data encrypted. You have some tenths of a second delay but you know that the data are saved and encrypted.
Post Reply