Hi all,
let me share with you following compiled versions of SQLite for Windows CE 5/6 (arm4i).
Download URL:
SQLite 3.9.2 (+ version with AES-128 enc.) MD5 checksums:
db83043f404e866dbdf4b9c4554fb6ca sqlite3ce.dll
8b27b589c91fb6eadf8fc5fb9e22098f sqlite3ce-aes.dll
Built with following preprocessor macros:
_UNICODE
UNICODE
NO_TCL
SQLITE_DEFAULT_FOREIGN_KEYS=1
SQLITE_DEFAULT_MMAP_SIZE=2097152
SQLITE_DISABLE_LFS
SQLITE_OMIT_TCL_VARIABLE
SQLITE_OMIT_TRACE
SQLITE_HAS_CODEC
CODEC_TYPE=CODEC_TYPE_AES128
SQLITE_CORE;THREADSAFE=0
SQLITE_THREADSAFE=0
SQLITE_USER_AUTHENTICATION
SQLITE_ENABLE_EXTFUNC
Download URL:
SQLite 3.11.1.0 (with AES-128 encryption & threadsafe=1)Built with following preprocessor macros:
_UNICODE;UNICODE;NO_TCL;SQLITE_DEFAULT_FOREIGN_KEYS=1;SQLITE_DEFAULT_MMAP_SIZE=2097152;SQLITE_DISABLE_LFS;SQLITE_OMIT_TCL_VARIABLE;SQLITE_OMIT_TRACE;SQLITE_HAS_CODEC;CODEC_TYPE=CODEC_TYPE_AES128;SQLITE_CORE;THREADSAFE=1;SQLITE_THREADSAFE=1;SQLITE_USER_AUTHENTICATION;SQLITE_ENABLE_EXTFUNC
To encrypt database in FreePascal / Lazarus / Delphi you have to first initialize the database with new password via sqlite3_rekey. After encrypting it is enough to use sqlite3_open following with sqlite3_key call...
// Encryption support
//
function sqlite3_key(db: PSQLite3; const pKey: PAnsiChar; nKey: Integer): Integer; cdecl; external 'sqlite3ce-aes.dll';
function sqlite3_rekey(db: PSQLite3; const pKey: PAnsiChar; nKey: Integer): Integer; cdecl; external 'sqlite3ce-aes.dll';
Before opening database it is good to check first 6 bytes of file to compare them with "SQLite" - this means db is unencrypted so you dont have to call sqlite3_key after sqlite3_open.
Examples:
1, opening and encrypting DB file
sqlite3_open('test.db', db);
sqlite3_rekey(db, 'test', Length('test'));
// then use db as usual
2, opening already encrypted DB
sqlite3_open('test.db', db);
sqlite3_key(db, 'test', Length('test'));
// then use db as usual
3, decrypt database file
sqlite3_open('test.db', db);
sqlite3_key(db, 'test', Length('test'));
sqlite3_rekey(db, '', 0); // length 0 will decrypt database file
// then use db as usual
Regards,
Jan