Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Make sqlite database file not to open using any browser ?
Forum Updated to NodeBB v4.3 + New Features

How to Make sqlite database file not to open using any browser ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Beemaneni Bala
    wrote on 18 Nov 2016, 14:48 last edited by
    #1

    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

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 18 Nov 2016, 14:57 last edited by VRonin
      #2

      https://github.com/sijk/qt5-sqlcipher

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      R 1 Reply Last reply 9 Mar 2018, 05:18
      2
      • B Offline
        B Offline
        Beemaneni Bala
        wrote on 21 Nov 2016, 06:44 last edited by
        #3

        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

        R 1 Reply Last reply 9 Mar 2018, 04:42
        0
        • V Offline
          V Offline
          VRonin
          wrote on 21 Nov 2016, 08:37 last edited by VRonin
          #4

          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'");

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          1
          • B Offline
            B Offline
            Beemaneni Bala
            wrote on 21 Nov 2016, 12:57 last edited by
            #5

            Hi
            Thanks for the help.
            I did following things on terminal on linux.
            Created a database using

            sqlcipher 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

            1 Reply Last reply
            0
            • B Beemaneni Bala
              21 Nov 2016, 06:44

              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

              R Offline
              R Offline
              RaguSweety
              wrote on 9 Mar 2018, 04:42 last edited by
              #6

              @Beemaneni-Bala

              Hello 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

              1 Reply Last reply
              0
              • V VRonin
                18 Nov 2016, 14:57

                https://github.com/sijk/qt5-sqlcipher

                R Offline
                R Offline
                RaguSweety
                wrote on 9 Mar 2018, 05:18 last edited by
                #7

                @VRonin

                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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved