storesafe / cordova-sqlcipher-adapter

A Cordova/PhoneGap plugin to create and access encrypted databases on Android, iOS, and Windows with API similar to HTML5/Web SQL API
Other
89 stars 55 forks source link

cordova-sqlite-plugin and existing database #76

Open davguev opened 6 years ago

davguev commented 6 years ago

Hello! I have an app which uses cordova-sqlite-plugin for its database.

  1. If I install cordova-sqlcipher-adapter, can I remove the first plugin? Or do I need both? I tried removing the sqlite-plugin and the app couldn't find the object sqlitePlugin.
  2. If the app has already its database X without cipher, and then install a new version of the app with the cipher, does it cipher the existing database X? If it's doesn't do it automatically, how can I achieve it without deleting the data already stored?
brodycj commented 5 years ago
  1. cordova-sqlcipher-adapter, can I remove the first plugin?

Yes and you better remove the other plugin first. Keeping both plugins would lead to undefined behavior.

2. does it cipher the existing database X?

No. You would open the database using no password key option.

2. how can I achieve it without deleting the data already stored?

I recommend you read the data with no key and store it in a new database using your secret password key.

SQLCipher has migration support, which is not directly supported by this plugin.

mknnaren commented 5 years ago

Hi,

Could you please add this information of removing cordova-sqlite-plugin before installing your plugin in readme file. Even I was debugging for long time on why this was not working until I hit this issue.

Thank you, Naren

sachinkumaram-veoci commented 5 years ago

@davguev Could you guide me on how to migrate data from one DB to secure DB.