How to encrypt the sqlite3 Database

Source: Internet
Author: User

HowSqlite3Database Encryption

1. Please follow the author's article to create a dynamic link library for sqlite3

How to Use vc6 to compile sqlite3 source code to generate a dynamic link library (Version: sqlite-source-3_6_23_1)

2. Obtain the wxsqlite3-1.9.8.zip software development kit through the Internet.

3. Decompress

Decompress wxsqlite3-1.9.8.zip software development kit

4. Copy

Copy all files under the wxsqlite3-1.9.8/sqlite3/secure/src/codec-C directory to the sqlite3 project directory

5. Add the header file:

Add the three headers codec. H, Rijndael. H, and sha2.h to the header file of the project.

Modify the codec. h header file

Open codec. h and add # include "sqliteint. H" under # include "Rijndael. H"

6. Modify the pager. c file

Open the sqlite3secure. C source file and copy the entire file;

Paste it to the end of the pager. c file and run the statement "# endif/* sqlite_omit_diskio;

Note: You can also delete the excess "# ifndef sqlite_omit_diskio and # endif/* sqlite_omit_diskio */" in the paste part;

7. added two compilation switches:

1. sqlite_has_codec;

2. threadsafe;

8. Add two lines at the end of the sqlite3.def file:

Sqlite3_key and sqlite3_rekey

That is, two functions, sqlite3_key and sqlite3 _ rekey, are exported.

 

9. Compile (end ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.