Databases not keying properly in iOS 10?

Hi @sjlombardo - I am also facing one issue in sqlcipher in iOS 10.

  • I have done below code to encrypt DB.

    sqlite3 db1;
    if (sqlite3_open([[self.databaseURL path] UTF8String], &db1) == SQLITE_OK) {
    const char
    key = [@“strong” UTF8String];
    sqlite3_key(db1, key, (int)strlen(key));
    if (sqlite3_exec(db1, (const char*) “SELECT count(*) FROM sqlite_master;”, NULL, NULL, NULL) == SQLITE_OK) {
    NSLog(@“Password is correct, or a new database has been initialized”);
    } else {
    NSLog(@“Incorrect password!”);
    }
    sqlite3_close(db1);
    }

Database encryption is working perfectly.

  • Now if i am going to perform any operation on database than got error “file is encrypted or is not a database”

Can you pls help me ?

1 Like