« AES CTR | Main | Conferencing »

20 October 2004

Crypto SQLite

Create a new encrypted database:

C:\tmp\>sqlcrypt.exe encrypted.db
SQLcrypt version 3.0.7
Enter ".help" for instructions
sqlcrypt> .encrypt "this is a passphrase with spaces"
sqlcrypt> create table a (ak int, av int);
sqlcrypt> insert into a values (1,1);
sqlcrypt> insert into a values (2,2);
sqlcrypt> select * from a;
1|1
2|2
sqlcrypt> delete from a where ak = 1;
sqlcrypt> select * from a;
2|2
sqlcrypt>

Open an existing encrypted database:

C:\tmp\>sqlcrypt.exe encrypted.db
SQLcrypt version 3.0.7
Enter ".help" for instructions
sqlcrypt> .decrypt "this is a passphrase with spaces"
sqlcrypt> select * from a;
2|2
sqlcrypt>

Attach an encrypted database:

C:\tmp\>sqlcrypt.exe encrypted2.db
SQLcrypt version 3.0.7
Enter ".help" for instructions
sqlcrypt> .encrypt "another encrypted database"
sqlcrypt> create table b (bk int, bv int);
sqlcrypt> insert into b values (9,9);
sqlcrypt> insert into b values (8,8);
sqlcrypt> attach_passphrase "this is a passphrase with spaces" "encrypted.db" as a;
sqlcrypt> select * from a.a;
2|2
sqlcrypt>

Open the encrypted database with stock SQLite executable:

C:\tmp\>sqlite3.exe encrypted.db
SQLite version 3.0.7
Enter ".help" for instructions
sqlite> select * from a;
SQL error: file is encrypted or is not a database
sqlite>

Very simple API:

int sqlcrypt3_passphrase(sqlite3 *, unsigned char *, int, unsigned char **);

This is a commercial product. There are a couple of issues to think through, then I'll start a beta programme, probably next week. Write me if you're interested. Beta testers who provide feedback get a complimentary license.


Posted by ngps at 00:37 | Comments (2) | Trackbacks (0)
Comments
Re: Crypto SQLite

Is it Windows only? No Linux version?

Posted by: kas at October 23,2004 15:19
Re: Crypto SQLite

SQLcrypt is a source modification to SQLite, so versions for Linux, BSD, Mac OS X, other Unixen, etc., are certainly possible. The coming beta will be Windows-only.

Which Linux distro do you use?

Posted by: Ng Pheng Siong at October 23,2004 20:28
Trackbacks
Please send trackback to:http://sandbox.rulemaker.net/ngps/136/tbping
There is no trackback.