-
Notifications
You must be signed in to change notification settings - Fork 568
non-encrypted db not being created by net.sqlcipher.database.SQLiteDatabase. #100
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
Comments
Hi, I'm using command line to check this but the sqlite3 in android sdk does not supports net.sqlcipher.database.SQLiteDatabase. So, maybe it shows every database created by sqlcipher as encrypted. |
Why don't you just use the standard Android Database API to create the unencrypted database? We designed the SQLCipher API to be as interoperable as possible with standard Cursors and the like, so there is very little difference in the code. You just need a helper class to call the specific database setup API, either the SQLCIpher package or the stock android.database. |
By specifying an empty string as "" in the argument, you are actually just setting the key to an empty string, like a blank password. This will create an encrypted database, as you discovered, with a blank password, and not an unencrypted database. |
I got my answer. Using empty string string as password does creates non-encrypted db. My problem was that I was using command line(sqlite3 in sdk) to check db; It does not supports sqlcipher.database so it always returned db as encrypted. I pulled my db from device using 'pull' button in eclpise and then opened it in Lita(software for viewing db). The db with empty key opens up but with non-empty key it tells that db is encrypted and thus can't be opened. |
Hi iffrah19, You can use a SQLCipher shell to interact with both a SQLite or a SQLCipher database. Instructions for building it can be found here. I am unaware of SQLCipher support in Lita. |
In my android app, I need to give user an option to create an encrypted or non-encrypted database; The database will be saved in device sdcard.
For the non-encrypted db I'm using :-
db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, "", null);
but when I open the db through command line,it gives error: file is encrypted or is not a database. So the above code line always creates encrypted database.
My code is below:
Any way to create non-encrypted database using sqlcipher in android?.
The text was updated successfully, but these errors were encountered: