0

here is my code to create a new encrypted database

sqlite3 *db;

if (sqlite3_open([databasePath UTF8String], &db) == SQLITE_OK) {
    const char* key = "sssri";    //the key to encrypt the database
    sqlite3_key(db, key, strlen(key));    //using the SQLCipher to encrypt database
    if (sqlite3_exec(db, (const char*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) {
        NSLog(@"password is correct, or, database has been initialized");  //this step is also successful
        if(sqlite3_exec(db, (const char*)"create Table student (name char(4) primary key,class varchar(50) not null)", NULL, NULL, NULL)== SQLITE_OK)
        {
            NSLog(@"create a table")    //create a table if not the database is empty,and create successfully
            ;            }

    } else {
        NSLog(@"incorrect password!");
  }

    sqlite3_close(db);

but when i try to open the sqlite database in my app documents using the SqliteManger tool ,i input the "sssri" key ,the database can't be opened correctly.

Why?Some help will be appreciated!

2 Answers 2

2

The SQLite Manager tool does not support SQLCipher. If you would like to interact with a SQLCipher database, outside of your codebase, consider using the SQLCipher command line shell.

Sign up to request clarification or add additional context in comments.

Comments

0

Try using version 4.3.0 (or later): http://www.sqlabs.com/news/sqlitemanager/

Comments

Your Answer

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.