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. Using SQLCipher in place of SQLite
Forum Update on Monday, May 27th 2025

Using SQLCipher in place of SQLite

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 11.0k Views
  • 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.
  • X Offline
    X Offline
    XelaG
    wrote on last edited by
    #1

    Hello,

    I would like to use encrypted SQLite databases with Qt.
    The company I work for, has been using SQLCipher with C++ Builder XE3 for almost two years (they bought a license). In this context it's pretty easy cause there's only a sqlite3.dll file to load.

    We're switching from C++ Builder to Qt.
    With Qt I can access SQLite database with the sqlite3 driver compiled with Qt. I tried it, it works and it's pretty easy to use.

    According to the documentation it is possible to link with my own sqlite library ("How to Build the QSQLITE Plugin":http://qt-project.org/doc/qt-5.0/qtsql/sql-driver.html#qsqlite).

    When we bought a SQLCipher licence we got a zip file which contains the following file:

    • sqlite3.c (SQLite Amalgamation file)
    • sqlite3.h
    • libeay32.lib
    • sqlite3.dll
    • sqlite3.lib

    I tried to recompile the SQLite driver for Qt but it failed.
    Here the step I followed:

    • Configure with qmake
      @qmake "INCLUDEPATH+=C:/AEProjects/SDKs/SQLCipher/binaries/" "LIBS+=-LC:/AEProjects/SDKs/SQLCipher/binaries/win32/lib -lsqlite3"@
    • build it
      @mingw32-make@

    But it failed with the error : "ld.exe: cannot find -lsqlite3"

    Do you think it's due to the sqlite3.lib file which might be sqlite3.a ?
    In this case I will have to recompile sqlcipher with mingw-32.

    I've seen those articles but I wanted to only link a specifc lib without recompiling SQLCipher.
    "Building QSQLITE driver with AES-256 encryption support":http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support

    "SQLCipher for Qt":http://www.wiki.crossplatform.ru/index.php/Привязка_SQLCipher_к_Qt#.D0.9E.D0.B1.D1.81.D1.83.D0.B6.D0.B4.D0.B5.D0.BD.D0.B8.D0.B5

    Does anyone have an idea ?

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding

    Q 1 Reply Last reply
    0
    • X XelaG

      Hello,

      I would like to use encrypted SQLite databases with Qt.
      The company I work for, has been using SQLCipher with C++ Builder XE3 for almost two years (they bought a license). In this context it's pretty easy cause there's only a sqlite3.dll file to load.

      We're switching from C++ Builder to Qt.
      With Qt I can access SQLite database with the sqlite3 driver compiled with Qt. I tried it, it works and it's pretty easy to use.

      According to the documentation it is possible to link with my own sqlite library ("How to Build the QSQLITE Plugin":http://qt-project.org/doc/qt-5.0/qtsql/sql-driver.html#qsqlite).

      When we bought a SQLCipher licence we got a zip file which contains the following file:

      • sqlite3.c (SQLite Amalgamation file)
      • sqlite3.h
      • libeay32.lib
      • sqlite3.dll
      • sqlite3.lib

      I tried to recompile the SQLite driver for Qt but it failed.
      Here the step I followed:

      • Configure with qmake
        @qmake "INCLUDEPATH+=C:/AEProjects/SDKs/SQLCipher/binaries/" "LIBS+=-LC:/AEProjects/SDKs/SQLCipher/binaries/win32/lib -lsqlite3"@
      • build it
        @mingw32-make@

      But it failed with the error : "ld.exe: cannot find -lsqlite3"

      Do you think it's due to the sqlite3.lib file which might be sqlite3.a ?
      In this case I will have to recompile sqlcipher with mingw-32.

      I've seen those articles but I wanted to only link a specifc lib without recompiling SQLCipher.
      "Building QSQLITE driver with AES-256 encryption support":http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support

      "SQLCipher for Qt":http://www.wiki.crossplatform.ru/index.php/Привязка_SQLCipher_к_Qt#.D0.9E.D0.B1.D1.81.D1.83.D0.B6.D0.B4.D0.B5.D0.BD.D0.B8.D0.B5

      Does anyone have an idea ?

      Q Offline
      Q Offline
      QtDeveloper
      wrote on last edited by
      #2

      @XelaG
      Have a look on this link.

      p3c0P 4 2 Replies Last reply
      0
      • Q QtDeveloper

        @XelaG
        Have a look on this link.

        p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        Hi @QtDeveloper
        Are you the author of that post ? If yes then I would suggest you to add it to http://wiki.qt.io.
        It is a common place for such articles.

        157

        1 Reply Last reply
        0
        • Q QtDeveloper

          @XelaG
          Have a look on this link.

          4 Offline
          4 Offline
          4j1th
          wrote on last edited by
          #4

          @QtDeveloper I tried that like, On step-6 section 'Compile the QSQLCIPHER-driver-plugin for Qt', executing mingw32-make I got an error message.

          I can't understand the error:

          C:\Qt\Qt5.4.2\5.4\Src\qtbase\src\plugins\sqldrivers\sqlcipher>mingw32-make

          mingw32-make -f Makefile.Release all

          mingw32-make[1]: Entering directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sq
          ldrivers/sqlcipher'

          mingw32-make[1]: *** No rule to make target '.moc/release/smain.moc', needed by
          '.obj/release/smain.o'. Stop.

          mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.4.2/5.4/Src/qtbase/src/plugins/sql
          drivers/sqlcipher'

          makefile:38: recipe for target 'release-all' failed

          mingw32-make: *** [release-all] Error 2

          Pardon my English
          Thank you.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leonardo
            wrote on last edited by
            #5

            Take a look at this project:

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

            4 1 Reply Last reply
            0
            • L Leonardo

              Take a look at this project:

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

              4 Offline
              4 Offline
              4j1th
              wrote on last edited by
              #6

              @Leonardo I almost finished the compiling in this method, but I can't understand the error

              Pardon my English
              Thank you.

              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