Comments (6)
- This plugin supports both encryption and decryption.
- You can already use
PRAGMA key='...'
from nativescript-sqlite.
PRAGMA key ='somekey' to set encryption on a non encrypted database does not work. If a database is already encrypted, I could decrypt with options:key and then add a new key with PRAGMA rekey = '';
Also the release notes specify:
"Please note the database itself MUST be created with encryption to use encryption. So if you create a plain database, you can not retroactively add encryption to it".
Thats the reason I was wondering if I could make this plugin use my paid SEE extension (sqlite3.c)
from nativescript-sqlite.
Yes, you have to create a new database with encryption (which you can do with a create database command or ship a encrypted db). You are correct it won't encrypt a un-encrypted database, however you can work around by just create a new database and copy all data from the old database and then delete the old un-encrypted version.
However, for security; if you are wanting to have encrypted db's it is better to start with a encrypted database rather than a unencrypted database.
from nativescript-sqlite.
Thanks for confirming.
What you are saying, is indeed one of my options: Ship an encrypted database with the app to begin with --> decrypt with your plugin --> rekey as needed.
I would have to explore the other approach you suggested aka create a new encrypted database and then copy over stuff from the old unencrypted one. Although, I don't want to put all this script in the app code. So most likely I won't go with this option. Still its good to know that your plugin can create a new db with encryption turned on.
Finally, just out of continued curiosity, is it possible to make use of a custom sqlite3 library in your plugin? The module.modulemap under platform/ios seems to specify the library. I was wondering if I could do something there to pick up my custom sqlite3.c?
from nativescript-sqlite.
Well, we could build you a custom version with your sqlite3.c file; it is basically just building a new aar (on android) and framework on ios to be linked in and using them as the native part. The rest of the code base (like the JS) would work with no other changes; so it is really just creating new native libraries using he SEE version of sqlite instead of SqlCipher.
from nativescript-sqlite.
Got it. Thats exactly what I was looking for. Infact, we have got around this use case by using open source SqlCipher to initially encrypt the database during the build phase and then use your paid plugin to decrypt and rekey as needed. So I am good now. Its still good to know that you can package a custom sqlite version, if needed. Thank you!
from nativescript-sqlite.
Related Issues (20)
- Run ATTACH command? HOT 1
- demo doest work on iOS HOT 2
- In-Memory Databases do not work in android
- Multiple documentation issues (and one real) HOT 4
- execSql weird error handling HOT 1
- Build fails with NativeScript 6.5 ./gradlew (failed with exit code 1) HOT 3
- Module not found: Error: Can't resolve 'nativescript-sqlite-sync' with commercial licence HOT 2
- Upgrade to Nativescript 7 HOT 2
- Where does actual data store? HOT 1
- Return and display blob into img example? HOT 3
- Execsql failed to prepare:1 HOT 2
- Commercial License HOT 4
- What needs to be modified when working with nativescript 8 ? HOT 3
- Got resultSet of 'undefined' after upgrading to NS 8 HOT 4
- App crashs on IOS 14.5.1 + HOT 7
- Can't resolve 'nativescript-sqlite-commercial/commercial-multi' HOT 9
- iOS: Update from {N} 8.0 to 8.1 creates toString from null error HOT 29
- SELECT error: SQLITE.ALL - Prepare Error 1 when migrating from {N} 6.8 to 8.1 HOT 7
- Uncaught TypeError: nativescript_sqlite__WEBPACK_IMPORTED_MODULE_0__.Sqlite is not a constructor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-sqlite.