0

I want to know this code is necessary to use in SQLcipher.(using in android)

I am confused where and when should i use this if needed.

i want to encrypt my sqlite db.

ATTACH DATABASE 'encrypted.db' AS encrypted KEY 'secret'; -- create a new encrypted database
CREATE TABLE encrypted.t1(a,b); -- recreate the schema in the new database (you can inspect all objects using SELECT * FROM sqlite_master)
INSERT INTO encrypted.t1 SELECT * FROM t1; -- copy data from the existing tables to the new tables in the encrypted database
DETACH DATABASE encrypted;
asked Feb 4, 2013 at 4:48

1 Answer 1

1

The sample code you have posted below allows you to attach a database and replicates a single table into from an existing database. If you intend on replicating the schema and content from one database to another, it is recommended to use the convenience function sqlcipher_export. You can read more about it with examples here.

answered Feb 5, 2013 at 14:00
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.