0

How to set password for DB(Sqlite) in QML, that should be prevent the others from opening the DB without password.

Sanjeev Kumar
  • 13
  • 1
  • 4
  • If you don't use the QML compiler you can't, as the QML files will accompany your app in (more or less) plain text. You can have it in a TXT-File in your QRC to add a bit of obfuscation. This will pack it in a modified ZLIB-file. http://www.psdevwiki.com/ps3/Qt_Resource_Container_(QRC). You can also modify any QML file to ouptut the QRC-stuff. – derM - not here for BOT dreams Aug 22 '17 at 11:56
  • 1
    I don't know SQLite that well, but maybe you can create only necessary views for QML and be ok with the user reading it directly. Or you hide the SQLite db in a C++ wrapper. On the other hand, it is usually not advised to have the password in the source code, for changing it will require recompilation. Also a compiled string is nothing more than obfuscation either. – derM - not here for BOT dreams Aug 22 '17 at 12:01
  • As I remember LocalStorage doesn't support passwords. You should implement your own protection level, encrypted fields content or whatever like this. – folibis Aug 22 '17 at 13:52
  • See this question: https://stackoverflow.com/questions/5669905/sqlite-with-encryption-password-protection – MrEricSir Aug 22 '17 at 17:18

0 Answers0