Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. C++ SQLite3 encrypted DB
Forum Updated to NodeBB v4.3 + New Features

C++ SQLite3 encrypted DB

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 5 Posters 6.9k Views 1 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.
  • M Offline
    M Offline
    MrLibya
    wrote on 19 May 2017, 10:35 last edited by
    #1

    Hallo

    I've encrypted my SQLite3 db by Navicat ! : alt text

    So my code:

    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
        db.setDatabaseName(QApplication::applicationDirPath()+ QDir::separator() + "test.db");
    

    and db.login() return true ;

    but my trying to execute a query :

    QSqlQuery q("SELECT * FROM test");
        while(q.next())
            qDebug()<<q.value(0).toString();
        qDebug()<<q.lastError().text();
    

    so i got :

    "file is encrypted or is not a database Unable to execute statement"
    

    i've also try to

    db.setPassword("mypass");
    

    but also didn't work

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 May 2017, 11:36 last edited by
      #2

      Hi,

      SQLite is not encrypted by default so you should check with the Navicat folks whether they are using SQLCipher for that.

      AFAIR, there are instructions available to build a plugin for Qt using SQLCipher so it's worth checking.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 19 May 2017, 12:08
      0
      • S SGaist
        19 May 2017, 11:36

        Hi,

        SQLite is not encrypted by default so you should check with the Navicat folks whether they are using SQLCipher for that.

        AFAIR, there are instructions available to build a plugin for Qt using SQLCipher so it's worth checking.

        M Offline
        M Offline
        MrLibya
        wrote on 19 May 2017, 12:08 last edited by MrLibya
        #3

        @SGaist i've checked they use wxSQLite3 for encrypet , Qt dosen't supoort it right ? so i need to include the wxSQLite3 library in my project and use it ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 19 May 2017, 20:09 last edited by
          #4

          Looks like you might be lucky. QtCipherSqlitePlugin.might be what you need.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply 19 May 2017, 21:39
          3
          • S SGaist
            19 May 2017, 20:09

            Looks like you might be lucky. QtCipherSqlitePlugin.might be what you need.

            M Offline
            M Offline
            MrLibya
            wrote on 19 May 2017, 21:39 last edited by
            #5

            @SGaist thx :)

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Ryna
              wrote on 13 Sept 2019, 21:54 last edited by
              #6

              @sgaist said in C++ SQLite3 encrypted DB:

              QtCipherSqlitePlugin

              As far as I understand QtCipherSqlitePlugin is not an open source. Do we have something in open source which encrypt the data in database? I tried SQLCipher from https://www.zetetic.net/sqlcipher/open-source/ but I am unable to use it as an usual external library in Qt. Isn't it possible? Can you please give me some suggestion on which database i can use, which provides encryption, is open source and can get easily get integrated in Qt?

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 14 Sept 2019, 14:47 last edited by
                #7

                @ryna said in C++ SQLite3 encrypted DB:

                As far as I understand QtCipherSqlitePlugin is not an open source.

                Why not? It's LGPL 2.1

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  Bharath Ram
                  wrote on 14 Mar 2021, 11:30 last edited by
                  #8
                  This post is deleted!
                  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