title: Unable to open manually-encrypted SQLite database with QtCipherSqlitePlugin and vice versa
body: <p>I have manually created a SQLite database (named &quot;localDB.db&quot;) and protected it with a password, by using <a href="http://sqlitebrowser.org/" rel="nofollow noreferrer">DB browser</a>. If I am not mistaken, DB browser uses SQLCipher (with a default page size of 1024), for encrypting a database.
  However, if I try to open the database with the QT plugin <a href="https://github.com/devbean/QtCipherSqlitePlugin" rel="nofollow noreferrer">QtCipherSqlitePlugin</a> (see following code), I always get the error that &quot;the password is invalid or cipher does not match&quot;, although I obviously provide the correct password and have set the cipher as &quot;sqlcipher&quot;.</p>
  <pre><code>#include &lt;QCoreApplication&gt;
  #include &lt;QDebug&gt;
  #include &lt;QDir&gt;
  #include &lt;QSqlError&gt;
  #include &lt;QtSql/QSqlDatabase&gt;
  
  #ifdef Q_OS_IOS
  
  #include &lt;QtPlugin&gt;
  
  Q_IMPORT_PLUGIN(SqliteCipherDriverPlugin)
  
  #endif
  
  #define CONNECTION_FAILED -1
  
  int main(int argc, char *argv[])
  {
      QCoreApplication a(argc, argv);
  
      qDebug() &lt;&lt; QSqlDatabase::drivers();
  
      QString dir = QCoreApplication::applicationDirPath();
      QString db_file_path = dir + &quot;/Data/localDB.db&quot;;
      qDebug() &lt;&lt; &quot;DB file path is:&quot; &lt;&lt; db_file_path;
  
      QSqlDatabase db = QSqlDatabase::addDatabase(&quot;SQLITECIPHER&quot;);
      db.setDatabaseName(db_file_path);
      db.setPassword(&quot;test&quot;);
      db.setConnectOptions(&quot;QSQLITE_USE_CIPHER=sqlcipher&quot;);
      db.open();
  
      if (!db.isOpen())
      {
          qDebug() &lt;&lt; &quot;Connection failed: &quot; &lt;&lt; db.lastError().driverText();
          exit(CONNECTION_FAILED);
      }
  
      return 0;
  }
  </code></pre>
  <p>The same happens for the inverse process: if I encrypt a database by using this plugin, then I am unable to manually open the database with DB Browser or other similar programs, because it does not accept the password.</p>
  <p>How can I solve this problem? I need to access an encrypted SQLite database through both my software and a third-party application like DB browser.
  Thanks in advance.</p>