wxsqlite3.4.2.0 how to open old encryted database
Posted: Mon Nov 05, 2018 9:38 am
I have some old database (encryted with AES256 using wxsqlite3.3.5.0.dll) which I want to access after switching to wxsqlite3.4.2.0.
According to the documentation, I need to run one of the following (depend on the encryption method used) :
SELECT wxsqlite3_config("cipher", "aes256cbc");
SELECT wxsqlite3_config("aes256cbc", "legacy", 0);
SELECT wxsqlite3_config("aes256cbc", "legacy", 1);
SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 1024);
SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 4096);
SELECT wxsqlite3_config("aes256cbc", "kdf_iter", 4001);
I tried each and every one of the above (with freepascal and zeolib component)
zconnection.ExecDirect( 'SELECT wxsqlite3_config("cipher", "aes256cbc");') etc but no success.
Error messge: My code:
Have I missed out something?
According to the documentation, I need to run one of the following (depend on the encryption method used) :
SELECT wxsqlite3_config("cipher", "aes256cbc");
SELECT wxsqlite3_config("aes256cbc", "legacy", 0);
SELECT wxsqlite3_config("aes256cbc", "legacy", 1);
SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 1024);
SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 4096);
SELECT wxsqlite3_config("aes256cbc", "kdf_iter", 4001);
I tried each and every one of the above (with freepascal and zeolib component)
zconnection.ExecDirect( 'SELECT wxsqlite3_config("cipher", "aes256cbc");') etc but no success.
Error messge: My code:
Code: Select all
procedure TForm1.bt1OpenTableClick(Sender: TObject);
begin
ZConnection1.Disconnect;
ZConnection1.Database := FileNameEdit1.FileName;
ZConnection1.Password := tx1Pass.Text;
if tx1Pass.Text > '' then
ZConnection1.Properties.Values['encrypted']:= 'True'
else
ZConnection1.Properties.Values['encrypted']:= 'False' ;
ZConnection1.Connect;
ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("cipher", "aes256cbc");');
// ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "legacy", 0);');
// ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "legacy", 1);');
// ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 1024);');
// ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "legacy_page_size", 4096);');
// ZConnection1.ExecuteDirect('SELECT wxsqlite3_config("aes256cbc", "kdf_iter", 4001);');
ZQuery1.Open;
end;