Skip to content

Converting the existing database to use SQL cipher library #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrejc opened this issue Sep 5, 2011 · 4 comments
Closed

Converting the existing database to use SQL cipher library #8

andrejc opened this issue Sep 5, 2011 · 4 comments
Labels
enhancement A software enhancement for SQLCipher for Android
Milestone

Comments

@andrejc
Copy link

andrejc commented Sep 5, 2011

Hi,
I was wondering if there is an easy way to update the app which is already using an unencrypted SQLite database to use the ciphered one? Obviously, one could load each value from the database manually, encrypt it and then write it back and then continue using the library in a standard way, but is there a more straightforward way?

Thanks,
Andrej

@eighthave
Copy link
Collaborator

SQLCipher should be able to open a normal SQLite database, then just 'rekey' it. Or you could export the db to SQL, and import it.

@n8fr8
Copy link
Collaborator

n8fr8 commented Sep 5, 2011

Yes, interesting use case. We don't currently support opening a db with providing an initial key. We should write a test for this!

@n8fr8
Copy link
Collaborator

n8fr8 commented Sep 17, 2011

More on this... you can definitely do this via command line sqlite/sqlcipher, but not via the current API.

I will ask the SQLCipher core team if you can just "rekey" an existing database, to see if that is enough.

http://stackoverflow.com/questions/311691/importing-a-sqlite3-dump-back-into-the-database

@developernotes
Copy link
Member

Hi andrejc,

We have added a convenience function called sqlcipher_export() to do this very thing. Documentation on usage can be found here:

http://sqlcipher.net/sqlcipher-api/#sqlcipher_export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A software enhancement for SQLCipher for Android
Projects
None yet
Development

No branches or pull requests

4 participants