mercredi 1 juillet 2015

cant decrypt sqlite after SQLCipher

Im tying to Encrypt/Decrypt file with SQLCipher on mac.

this is what i do to encrypt db :

sqlite> ./sqlcipher test.db
sqlite> ATTACH DATABASE 'encrypted.db' AS encrypted KEY 'Sef*DFyds98fhsh2';
sqlite> SELECT sqlcipher_export('encrypted');
sqlite> DETACH DATABASE encrypted;

and after that i try this to open encrypted DB :

sqlite> ./sqlcipher encrypted.db
sqlite> PRAGMA key = 'Sef*DFyds98fhsh2';
sqlite> select * from tables;

and it gives me this error :

Error: file is encrypted or is not a database

one thing is my original db file is 1.6 Megabyte but after encryption it turns into 226 KlioByte.

Aucun commentaire:

Enregistrer un commentaire