How to Make sqlite database file not to open using any browser ?
-
wrote on 18 Nov 2016, 14:48 last edited by
Hi
I am working on sqlite database in my app , where i need to hide the data in database using some encryption methods. Please suggest me some methods to encrypt data going in to database and decrypt the same. Database will have 6 months of data.And at any point of time i need to decrypt the same. And i need to make sure the database file i created should not be opened through any browsers as well to decode the data(Other than password protected Method).
Please suggest me an right approach.Regards
Bala B -
wrote on 18 Nov 2016, 14:57 last edited by VRonin
-
wrote on 21 Nov 2016, 06:44 last edited by
Hi
Thanks for the help.
I have successfully installed sqlcipher on linux. But i am not sure how to encrypt the data that is inserted. Should i explicitely write functions for that or will sqlcipher handle ?Can you please suggest me.
Regards
Bala B -
wrote on 21 Nov 2016, 08:37 last edited by VRonin
The tests of that library provide a nice example: https://github.com/sijk/qt5-sqlcipher/blob/master/test-shared/main.cpp in the end it just needs a pragma query
db.exec("pragma key='myPassPhrase'");
-
wrote on 21 Nov 2016, 12:57 last edited by
Hi
Thanks for the help.
I did following things on terminal on linux.
Created a database usingsqlcipher comments.db and then inside sqlite->
sqlite> pragma key='foobar';
sqlite>create table foo (bar integer);
sqlite>insert into foo values (42);
and then
sqlite> select bar from foo; it gives me a value 42.and i quit the database and logged in again to check the value
sqlite> select bar from foo;
it says file is encrypted or is not a database.sqlite>pragma key='foobar';
sqlite> select bar from foo;still it shows the same error.
Is this how it works ? Can you please correct me if i am wrong.
Regards
Bala B -
Hi
Thanks for the help.
I have successfully installed sqlcipher on linux. But i am not sure how to encrypt the data that is inserted. Should i explicitely write functions for that or will sqlcipher handle ?Can you please suggest me.
Regards
Bala Bwrote on 9 Mar 2018, 04:42 last edited byHello Beemanen-Bala,
I am new with QT. Let me know how to install SQLCipher on linux with this link - https://github.com/sijk/qt5-sqlcipher -
wrote on 9 Mar 2018, 05:18 last edited by
Hello VRonin,
I am new with QT. Let me know how to install SQLCipher on linux with this link - https://github.com/sijk/qt5-sqlcipher