Greetings!
I know there are previous threads mentioned about Encryption issues regarding wxSQLite3(1.9.9 the latest).I built my wxSqlite lib without Encryption support,when I try to build with the Encryption support,build can not pass.I also know that there is a secure folder in the wxSqlite3 package,there are two sub folders,codec and codec-c.Under codec folder there is codec.h file which include s "../sqliteInt.h".where is sqliteInt.h?I can't see it.So I was lost on how to use secure source.
So my question is,is there a known way which can easily make Encryption support in wxSqlite works?I need a step to step guide.
I use have both Xp and Ubuntu 10.04 installed in my pc.C::B+wx works on both platform.
Thanks a lot for your help.
How to build wxSqlite dll with encryption support Topic is solved
How to build wxSqlite dll with encryption support
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Re: How to build wxSqlite dll with encryption support
The folder codec contains the C++ version of the encryption support. You would need all SQLite sources as separate files, i.e. not the amalgamation. The C++ version is no longer actively maintained.samsam598 wrote:I know there are previous threads mentioned about Encryption issues regarding wxSQLite3(1.9.9 the latest). I built my wxSqlite lib without Encryption support, when I try to build with the Encryption support, build can not pass. I also know that there is a secure folder in the wxSqlite3 package,there are two sub folders, codec and codec-c.
The folder code-c vcontains the C version of the encryption extension which works seamlessly together with the SQLite amalgamation.
Although this forum thread describes the process on Windows, it should be a sufficiently good guide for other platforms, too.samsam598 wrote:So my question is,is there a known way which can easily make Encryption support in wxSqlite works?I need a step to step guide.
Regards,
Ulrich
Re: How to build wxSqlite dll with encryption support
Thanks.The link provided guideline is very clear and workable.I built sqlite3 static and dll libraries under windows successfully for AEC128.But failed on AEC 256,both static and dll.Attached error log fyi.I uses wxDev-cpp +MinGW3.4.5,xp sp3.utelle wrote:The folder codec contains the C++ version of the encryption support. You would need all SQLite sources as separate files, i.e. not the amalgamation. The C++ version is no longer actively maintained.samsam598 wrote:I know there are previous threads mentioned about Encryption issues regarding wxSQLite3(1.9.9 the latest). I built my wxSqlite lib without Encryption support, when I try to build with the Encryption support, build can not pass. I also know that there is a secure folder in the wxSqlite3 package,there are two sub folders, codec and codec-c.
The folder code-c vcontains the C version of the encryption extension which works seamlessly together with the SQLite amalgamation.
Although this forum thread describes the process on Windows, it should be a sufficiently good guide for other platforms, too.samsam598 wrote:So my question is,is there a known way which can easily make Encryption support in wxSqlite works?I need a step to step guide.
Regards,
Ulrich
Moreover,the minimal sample runs differently compare to no encrypt support.The non-encryption version runs without a single problem,buth this one did not.
Code: Select all
cout << endl << "User Defined Collation Sequence Test" << endl;
db.SetCollation(wxT("reversed"), &myCollation);
db.ExecuteUpdate(wxT("create table testcol(textcol char(20) collate reversed);"));
db.ExecuteUpdate(wxT("insert into testcol values ('anton');"));
db.ExecuteUpdate(wxT("insert into testcol values ('berta');"));
db.ExecuteUpdate(wxT("insert into testcol values ('cesar');"));
wxSQLite3ResultSet q4 = db.ExecuteQuery("select textcol from testcol order by 1 desc;");
while (q4.NextRow())
{
cout << (const char*)(q4.GetString(0).mb_str()) << endl;
}
if (wxSQLite3Database::HasBackupSupport())
{
cout << endl << "Backup and restore database" << endl;
...
}
Code: Select all
Backup and restore database
26:SQLITE_NOTADB[26]: file is encrypted or is not a database
Press q then enter to quit:
Thanks again.
- Attachments
-
- errlog.txt
- (21.36 KiB) Downloaded 220 times
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Re: How to build wxSqlite dll with encryption support
I'll take a look at the log and try comment later on this issue.samsam598 wrote:I built sqlite3 static and dll libraries under windows successfully for AEC128.But failed on AEC 256,both static and dll. Attached error log fyi.I uses wxDev-cpp +MinGW3.4.5,xp sp3.
At the moment I don't know the answer. The backup succeeds if the destination database is not encrypted, that is, if the key passed to method Backup is not used. But this results in an unencrypted backup database file. I have to investigate how SQLite's backup works internally and what's causing the problem and how to solve it. So I have to ask for your patience.samsam598 wrote:Moreover,the minimal sample runs differently compare to no encrypt support.The non-encryption version runs without a single problem,buth this one did not.
[...]
When runs into the last line of the above code.Exception caught:I noticed you have provided the password to backup & restore function. So what is the problem?Code: Select all
Backup and restore database 26:SQLITE_NOTADB[26]: file is encrypted or is not a database Press q then enter to quit:
Regards,
Ulrich
Re: How to build wxSqlite dll with encryption support
The problem seems to be that an invalid typedef for the definition of the uint64 type is selected when MinGW is used. For MinGW it should beutelle wrote:I'll take a look at the log and try comment later on this issue.samsam598 wrote:I built sqlite3 static and dll libraries under windows successfully for AEC128.But failed on AEC 256,both static and dll. Attached error log fyi.I uses wxDev-cpp +MinGW3.4.5,xp sp3.
typedef unsigned long long uint64;
Probably sha2.h has to be adjusted for MinGW. It works with Visual C++ though.
Keep in mind that AES-256 support is still experimental.
Regards,
Ulrich
Re: How to build wxSqlite dll with encryption support
Hi Ulrich,
Thank you so much for your prompt reply and for your great support on wxSqlite always!
Regards,
Sam
Thank you so much for your prompt reply and for your great support on wxSqlite always!
Regards,
Sam
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Re: How to build wxSqlite dll with encryption support
In the end the explanation is really simple: if the backup destination database already exists and is not encrypted (or is encrypted with a different encryption key) you get the exception you observed. I'm sure you tested the minimal sample first without encryption and that test left an unencrypted backup database behind. Solution: delete the existing backup database file and run the sample application again and it should work as expected.samsam598 wrote:Moreover,the minimal sample runs differently compare to no encrypt support. The non-encryption version runs without a single problem,buth this one did not.
[...]
When runs into the last line of the above code.Exception caught:I noticed you have provided the password to backup & restore function. So what is the problem?Code: Select all
Backup and restore database 26:SQLITE_NOTADB[26]: file is encrypted or is not a database Press q then enter to quit:
Regards,
Ulrich
Re: How to build wxSqlite dll with encryption support
Yes,exactly.It works pretty good.Thanks again.utelle wrote:In the end the explanation is really simple: if the backup destination database already exists and is not encrypted (or is encrypted with a different encryption key) you get the exception you observed. I'm sure you tested the minimal sample first without encryption and that test left an unencrypted backup database behind. Solution: delete the existing backup database file and run the sample application again and it should work as expected.samsam598 wrote:Moreover,the minimal sample runs differently compare to no encrypt support. The non-encryption version runs without a single problem,buth this one did not.
[...]
When runs into the last line of the above code.Exception caught:I noticed you have provided the password to backup & restore function. So what is the problem?Code: Select all
Backup and restore database 26:SQLITE_NOTADB[26]: file is encrypted or is not a database Press q then enter to quit:
Regards,
Ulrich
Regards,
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build
Sam
-------------------------------------------------------------------
Windows 10 64bit
VS Community 2019
msys2-mingw13.2.0 C::B character set: UTF-8/GBK(Chinese)
wxWidgets 3.3/3.2.4 Unicode Mono Static gcc static build