c++ sqlite encrypt

Hello.
Using sqlite3 i have the c++ code ...

1
2
3
4
5
6
7
8
9
 if (sqlite3_open("myFile.db",&db) != SQLITE_OK)
    {
        wxMessageBox("Could not open database.");
        exit(123);
    }
    char *szErrMsg = 0;
    sqlite3_exec(db,"CREATE TABLE IF NOT EXISTS users(id integer primary key 
autoincrement not null,USERNAME varchar(30) UNIQUE , 
name varchar(30))", callback, 0, &szErrMsg);


I must encrypt myFile.db
How i can do that?
Last edited on
Put it in an encrypted volume?
No.
Just a database must be encrypted and with password.
There is an SQLite extension that provides transparent encryption (https://www.sqlite.org/see/ ), but it's not cheap. The source license by itself, without support, costs USD 2000.

If you can't afford thatm you'll have to figure something else out.
SEE i expensive for private use and small programs..
Maybe must use sqlcipher in community edition but i don’t know how.
Already have source code ...

An idea for change table and column names in data base is to change strings names...

Suppose USERNAME(inside string)must change to jaskda in db, how i can change it in code with #define, so not change all code, and for code is readable?
#define USERNAME jaskda
not work. Any idea?

1
2
3
sqlite3_exec(db,"CREATE TABLE IF NOT EXISTS users(id integer primary key 
autoincrement not null,USERNAME varchar(30) UNIQUE , 
name varchar(30))", callback, 0, &szErrMsg);


Last edited on
Topic archived. No new replies allowed.