Thank you Richard for the extremely quick response. I found the regular sqlite3::open method has an $encryption_key parameter.
https://www.php.net/manual/en/sqlite3.open.php As I am using PDO for the interface into SQLite, I wonder if there is a similar parameter for that interface. Perhaps using the $password parameter? There is very little documentation on this. https://www.php.net/manual/en/pdo.construct.php I see that you mentioned using PRAGMA statement for the activation of encryption. From my currently unencrypted database, and connecting to the SQLite database with PDO, how would I enable the encryption and then for subsequent queries ensure that the database file remains readable by my code base? I've looked at the PRAGMA statements and there doesn't appear to be any public documentation on this interface. https://www.sqlite.org/pragma.html I do understand this is outside of the scope of SQLite when asking for help with PHP's PDO interface. I'm just hoping that people on here have experience with PHP might have a solution. On Tue, Aug 20, 2019 at 2:56 PM Richard Hipp <d...@sqlite.org> wrote: > On 8/20/19, Mark Tomlin <m...@mimocad.io> wrote: > > I would like to use SQLite's Encryption Extension with my PHP 7.2 code > > base, as well as 7.3 and 7.4 code bases moving forward. My hope is is > that > > the see-sqlite.c code file can be simply renaming it to sqlite.c and > > dropping it into PHP's build directory.Then compiling it as I normally > > would. I'm also guessing I would have to modify the (see-)sqlite.c code > to > > make a call to sqlite3_key from within the sqlite3 function call so > > that the encryption is always on and would not require any modifications > to > > the PHP source code. > > You do not need to modify any C code, either in SQLite/SEE or in PHP. > You can activate encryption and set the encryption key using a PRAGMA > statement. > > > > > Has anyone done this before? > > Yes. > > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- Mark Tomlin, CEO. MimoCAD, Inc. P: (516) 234-0290 _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users