SQLcrypt™ Shell Demonstration

SQLcrypt™ comes with a command line shell program that can be used to administer SQLcrypt™ or SQLite database. This is a demonstration of the SQLcrypt™ shell from version 1.3.322.

» Create a new encrypted database

C:\tmp\>sqlcrypt.exe encrypted.db
SQLcrypt version 3.2.2
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> vacuum;
sqlcrypt> select * from a;
2|2
sqlcrypt>

» Open an existing encrypted database

C:\tmp\>sqlcrypt.exe encrypted.db
SQLcrypt version 3.2.2
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.2.2
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 an encrypted database with stock SQLite shell

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

SQLite Tutorial

Mike Chirico has produced an excellent tutorial on SQLite that is fully applicable to SQLcrypt™. Take a look.