Sqlite encryption in php

Hello,

Phpclass is OK, but it works with decrypted db, and encrypt it on the end and save it. I will test it with our app and see the output. The problem is that when using the db, it is visablble to other programs. Is it possible to decrypt it only in memory of Exeoutput?

What about the .dll https://github.com/rindeal/SQLite3-Encryption Is it possible to include it into Exeoutput.

BR.

Sure, you can compile your existing SQLite database into ExeOutput and it will be stored as a virtual file, only accessible by your program. However, changes won’t be saved unless you encrypt your database into an external file before the application closes.

Know this is old, very old but…

Has anyone discovered a way to lock or provide any type of encryption to sqlite? I cannot compile into exe and need to have in outside data folder.

Not looking for hacker proof, just looking to keep casual user from changing db tables.

See open source version of https://www.zetetic.net/sqlcipher/open-source/ which http://sqlitebrowser.org/ has incorporated. But see know way can use with EXEOut.

In a future release, we’ll add the ability to decrypt/encrypt external files, a similar feature already exists in HTMLEXE.

1 Like

I was in need of this myself and managed to build a php_pdo_sqlcipher extension (dll) that works like pdo_sqlite with all the encrypt / decrypt methods baked in from the sqlcipher project. I’ve put the built DLL on GitHub although it’s likely not hacker proof and currently only for PHP 5.6. If there’s enough interest I’ll add the steps it took to build.

2 Likes

Hello Mfink,

I am interested.

Thank-you,
Gilbert

Thanks @mfink, much appreciated. I would love to know how you made it.

Will try this on some older PHP 5.6 projects. Pretty much moved all new projects to PHP 7 : (

Thanks again for sharing.

Hot off the presses, I’ve added the steps to build for Windows here: https://github.com/kynetiv/php_pdo_sqlcipher/blob/master/examples/BUILD.md

Also built it with PHP 7 and added the built DLL. Let mew know how it works out for you or if you have any questions :slight_smile:

2 Likes

That is a very in-depth tutorial. Can tell that took some time.

Going to give a shot after the Holiday company goes home in a few days. Thank you once again for sharing.

1 Like

@mfink I had forgotten to thank you again for this!

We gave it a run in school computer lab and failed a few times (our mistype) but in end had working version. When get time, going to have to try for PHP7.2

Thanks again for the in-depth tutorial on GitHub.

1 Like

Still interested in the feature:)

1 Like

Just saw this. So glad it helped! It certainly is a walk in the dark to get this going.

For others who’ve commented on Github, I realized I should have mentioned you’ll need to include the php_curl dll to be compiled in the module since there isn’t a way (that I know of anyway!) to include the required OpenSSL dlls (ssleay32.dll & libeay32.dll) in the compiliation without curl (which does this by default).

Cheers.

1 Like

I did a small project with SQLite3 and pdo_sqlciper. I works fine just current public version only work with php 7.1.

Hello. How do you get pdo_sqlciper? This library works with phpdesktop? Thanks.

Is this feature released ?

The feature to encrypt external file (like in a data folder) has been implemented. You can choose to have external file, choose encryption and keep file in a folder. Have not used it, so can’t really comment about usage.

Please check
feature is not working
first i tried to encode sqlite .DB database file also marked as external file
it didnt worked
then i tried on .txt file
that also didnt worked

it’s so painful

please help me with sqlite database encryption or something like that please @oldteacher

i already tried this - php_pdo_sqlcipher/BUILD.md at master · kynetiv/php_pdo_sqlcipher · GitHub
But didn’t worked

@gdgsupport please give us an update fast :pray: :pray: :pray:
at least something for sqlite3 encryption

The encryption feature will work for PHP external files only. Not SQLite or other extensions.

The problem would be that encrypted files will be read-only. We are working on some workaround but the current problem is for very large SQLite database files.

Its been so long
please give some solution…

tried rindeal one
successfully encrypted database
but still no idea how to integrate this with php
replaced dll but then php gives error that SQlite3 class not found
help please