Encrpyt empty Sqlite DB in Command line

I am new to Sqlciper, I want to encrpyt the empty sqlite DB through command prompt. what are the steps needed to do that…

Hi @Gnanaprakasam,

Thank you for your interest in SQLCipher. If the database file does not exist when you open it on the command line, you will want to perform a key operation on the database file where you provide the password material used for encryption/decryption:

./sqlcipher demo.db
sqlite> PRAGMA key = 'YourPasswordGoesHere';
sqlite> CREATE TABLE t1(a, b);

After that, you can create your schema, provide data and the database file will be encrypted. You may be interested in reviewing our API documentation [1] which provide sample SQL commands for various operations.

  1. SQLCipher API - Zetetic ↩︎

Thanks for reply, It works for me.