Ok, I managed to build SQLCipher as an SQLite amalgamation on windows using cygwin, after that, I replaced the Data/SQLite/src sqlite3.h and sqlite3.c files with the SQLCipher amalgamated files.
Then added these two preprocessor directives for building: SQLITE_HAS_CODEC and SQLITE_TEMP_STORE=2 to the MSVC solution.
After that, I added in the include paths, the path to my openssl include folder.
Then I added in the lib paths, the path to my openssl lib folder.
For the shared builds, I added in the Linker -> Input -> Additional Dependencies: libeay32.lib
For the static builds, I added to Librarian -> Additional Dependencies: libeay32.lib
After that, just build, and for testing, I used the Tuple example for SQLite, first, I ran the example as it comes out of the box, and it generates a sample.db file, I opened the file with a Hex Editor, and I was able to read the data in clear text, and saw the Lisa and Bart Simpson text.
Now, for testing the encryption, I added the following code right after the: session << "CREATE TABLE Person ... line:
- Code: Select all
//add on line 62: encrypt and use password: passphrase
session << "PRAGMA key = 'passphrase'", now;
After that, it was able to print out the data to the screen, so it means it was able to read it correctly, and when I opened the sample.db file with the hex editor again, I saw garbage instead of clear text, which means the encryption was successful.
Can somebody please help me test this on other platforms to see that it works and see how can we integrate this to the POCO source?
I'm trying to attach the sqlite3 amalgamation files I created, but I guess the forum has issues with the 1MB zip file.