I’m coding in DART on Flutter.
I’m able to open a sqlite database with the key (checked it in DB Browser). And rest of app runs fine so DB is being opened ok.
I followed all recommendations across several sites but cannot change the key.
Here is my code to open the DB –
_db = await openDatabase(DestinationPath, password: pin);
Then immediately I supply the existing key and do the recommended query
_db?.execute(“PRAGMA key = ‘XXXX'”);
_db?.rawQuery(“SELECT COUNT(*) FROM sqlite_master;”);
No errors so far!
Next I try to rekey the database with
_db?.execute(“PRAGMA rekey = ‘YYYY'”)
Runs without error, but key is never changed.
Any ideas what I am doing wrong? Weird that no errors get fired.
I expected the database key to be changed as in the guidance on sqlcipher.
Eamon O Doherty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.