Hướng dẫn sqlite encryption php
I am considering supporting encrypted sqlite databases for a PHP application. I am using SQLite3 extension of PHP and it seems, that they already support an encryption method, at least SQLite3::__construct allows for an encryption-key to pass. What i was not able to figure out is, which encryption library they are talking about in the documentation. By googling i found the following:
What is not clear to me is:
Any help is very much appreciated!
PeeHaa 69.8k57 gold badges185 silver badges259 bronze badges asked Mar 1, 2012 at 9:54
The SQLite3 library needs to be built with support for encryption. Those projects (and a few more: https://stackoverflow.com/a/5877130/502789) can be used to get an sqlite3.so/dll with encryption support. So, the questions...
NB: I haven't used PHP + SQlite3 encryption.
answered Mar 3, 2012 at 14:28
OliJGOliJG 2,5401 gold badge15 silver badges15 bronze badges As far as I'm aware, the password you pass to the PHP open will only work if you are using a version of SQLite compiled with encryption support (i.e. the encryption doesn't work in a default build). We've had some users successfully use SQLCipher with PHP by building the PHP software with the SQLCipher codebase. More information is available in the thread here: http://groups.google.com/group/sqlcipher/browse_thread/thread/6d77e4ef2a1530d7 answered Mar 1, 2012 at 15:34
1 answered Jul 7, 2012 at 0:52
cking24343cking24343 3,0931 gold badge20 silver badges22 bronze badges Please see my answer here: https://stackoverflow.com/a/49161716/9418360 SQLite3 has built-in interface for encryption. You need to enable it in config.m4 : -DSQLITE_HAS_CODEC=1 I have developed my own encryption based on AES. A few C files in /ext/sqlite3/libsqlite and it works great. The whole database file is encrypted, no need to send encrypted data from PHP. As soon as I have my code ready to publish will update this post. Cheers. answered Mar 7, 2018 at 21:56
Not the answer you're looking for? Browse other questions tagged php encryption sqlite sqlcipher or ask your own question.
|