Many thanks your detailed explanations (in this forum as well as
https://forums.wxwidgets.or)
I think I can replace the old version with new one now.
For the benefit of other members who may be interested, I have summarised below what I have learned for wxsqlite3.4.2.0 (using lazarus with zeolib db component):-
1. before connecting to the database -
i) set the encrypted = 'True' (if database is encrypted, otherwise set this to '')
or set ZConnection1.Properties.Values['encrypted'] := 'True' // or 'False' as the cas may be
ii) set ZConnection1.Password
iii) call ZConnection1.Connect
2. If the database was not encryted, you should be able to operate it as usual now.
If the database was encryted, you must activate the encryption method by calling -
select wxsqlite3_config(cipherName, cipherParameter, newValue);
For the values of cipherName, cipherParameter, newValue, please refer to the files in
...\sqlite3secure\test\folder
For example, if the database was encrypted in with AES256, check the file setaes256wx.sql
and then call
ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("cipher", "aes256cbc");');
ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "legacy", 0);');
....
3. Finally, call pragma key="password" eg -
ZConnection1.ExecuteDirect('PRAGMA key="12345"' ); // say, 12345 is the password
With this, I can operate the database tables as usual now
Note:
Sstep 2 & 3 is not necessary if the database is encryted with default method i.e. chacha20.