Encrypt Sqlite with Qt using some open source solution - qt

My application is using Qt 4.6 to access sqlite. Now I have a requirement to encrypt sqlite database. On searching i do find SEE but this is licensed.
My problem is: I want to encrypt sqlite database using QT or some open source solution that is compatible with Qt. Do tell me some link or tutorial if you know.

Sqlcipher SQLite extension is what you need. Look into QTCentre about building sqlite version which supports encryption out of the box. The main benefit of this version that it provides standard qt sql interface via custom plugin. Also, it is BSD-like licenced.

Not sure if this is a good solution, but how about encrypting the file before opening the database and encrypting it again after closing it?
In any case, I don't think there's any way to make the data 100% secure. There will always be a moment where the data will be unencrypted (when your app reads it) and anybody could retrieve it at that time.

Related

How to encrypt SQLite DB in an electron app?

I have an electron app which persists data in an SQLite db stored in my machine. I have all the setup for the CRUD operation and the application works fine. Now I need to encrypt the SQLite DB file. I searched online for solution but all the solution are for pre-encrypted DB which is being decrypted inside Electron.
The requirement is, user will provide the password using which the app will encrypt the DB file and going forward user will provide the password to decrypt and perform the CRUD operation
Any idea how to achieve this?
P.S.: I have checked with SQLCipher docs and I don't find what I needed. So far, I am using sqlite3 node module to perform CRUD
Edit 1: I tried to use sqlite-cipher module and I was able to encrypt the db in a separate js file. but when I integrate the same with the electron ipcMain, the app closes due to high RAM consumption.
Any suggestions???
If you're using SQLite the best option is use SQLCipher. The problem is that you will have to compile new binaries to work and there are some limitations with the versions of SQLite and SQLcipher for node.
You can use this package: https://github.com/journeyapps/node-sqlcipher
or compiling manually, here you have an example https://gist.github.com/aguynamedben/14253e34bc7e0a881d99c8e45eb45a47
Encryption in electron app is a tricky thing.
This is because it can give you false sense of security.
You might encrypt your local db, but with electron it's so easy to decrypt it back that perhaps it's not worth it at all?
It's very easy to get sources of your electron app. Minification helps only a little bit, but this is not real protection.
There are many approaches you can take but they vary on circumstances.
The questions which needs to be answered are:
who are you trying to protect against?
is security critical or this is only basic measures so not everyone can get data from db at first
glance?
does the user using the app have admin user rights on the
machine?
are you accessing db directly through electron app, or some
kind of system wide service (deamon) is communicating with db and
passing results to electron app.
if previous is "yes" how do you communicate the
service with the electron app and how is this secured?
Take a look at source code access discussion:
https://github.com/electron/electron/issues/3041
and also check this article (especially the security part):
https://hackernoon.com/electron-the-bad-parts-2b710c491547

Will using dblinq to SQLite in a Windows Store app pass store validation?

I've been trying to figure out how to get a decent LINQ to something working for ORM database access in a Windows Store app.
All I've found is SQLite and the sqlite-net NuGet package. The latter sucks a bit, as I don't get any .dbml like structure which resolves relationships and provides navigation properties for easy querying (no manual joins needed then).
I was wondering:
Does dblinq in comnbination with SQLite offer this?
Will using this pass Windows Store validation?
Thank you !
Update: Some links I used in my research:
The famous Tim Heuer post on SQLite and Windows 8: http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
DBlinq: http://code.google.com/p/dblinq2007/
sqlite-net: http://code.google.com/p/sqlite-net/
Interesting discussion stating ADO.NET is not possible: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e9cdd75d-03e4-4577-988e-4c02a52e3f50
I'm not familiar with dblinq but by looking at the sqlite tests in the project, it seems the library is offering what you're looking for, i.e. navigation properties for relationships between different tables.
Since dblinq is a .NET library, using it shouldn't make the store validation fail. There is another problem though: you can't use such a .NET library in a Windows Store application, only Windows Store class libraries and portable class libraries are allowed. Since the source for the library is available, you can try compiling it as a Windows Store class library, but I'm afraid there are going to be some classes missing that dblinq is depending on which might make it difficult to port.

Is it possible to make a serverless client-side database program using sqlite and php?

I have a client who wants a small database program that can run on his personal computer. I've set up multiple mySQL databases in the past, and I prefer to program custom user interfaces using HTML, CSS, and PHP because it allows for a lot of customization. My question would be, is there a feasible way for me to create a client side database program using a SQLITE and HTML,CSS,PHP? Or should I consider another programming language?
*I've considered using a virtual lamp/wamp stack like XAMPP, but I was hoping to find a more efficient means.
I'm open to any ideas.
Thanks!
PHP 5.4 has a built-in webserver, which means you can develop an application which only dependency would be installing PHP on client machine. (I assume the web browser is already available)
Also, you may want to create a script (batch file) to start the server (and maybe launch the browser). SQLite support is included in default version of PHP.
http://php.net/manual/en/features.commandline.webserver.php

How can I save a Microsoft Access database as .sqlite database?

Are there any add-ons or something that can enable Microsoft Access to save its database as .sqlite?
Or do you know of any other way I can convert them, both ways.
Thanx a lot
If you can find an application (libreoffice?) or language with bindings/reader to access or if you can convert the access "db" into something sane, it shouldn't be too difficult to go to sqlite from there. The code you need will probably be specific to your particular database and not a universal Access->sqlite converter.
Actually, you might see if access could directly talk to sqlite over ODBC. Longshot, but that might be closest to a full answer to your question.
You could see these, for starters:
What do I need to read Microsoft Access databases using Python?
how to deal with .mdb access files with python
SQLite Syntax Error In Union Select Query From MS-Access
How to use sqlite database from inside MS Access?
ODBC/JDBC resources
Bindings and libraries for your favourite languages

Using Flexbuilder to create an AIR app connected to Saleforce.com, how can I encrypt the local datastore?

I have created an Adobe AIR application that interfaces with Salesforce.com. The only drawback I have is that the data that is synced to the desktop is not encrypted. I can encrypt a database that I create locally, however, I am trying to encrypt the database that is created and maintained by the flexforforce toolkit. Thanks for any suggestions.
J_A_X is correct, without access to the underlying code communicating to the database, it would be damn near impossible, however it appears the situation has changed.
AFAICT SalesBuilder is using a locally encrypted air database: http://coenraets.org/blog/2008/11/salesbuilder-15-with-new-air-15-database-encryption/. It appears the source code is available for this application, and thus a possibily that you might be able to pull the libraries this is using? Or perhaps the libraries you are using are in fact already encrypting the database?

Resources