Solved C++ SQLite3 encrypted DB
I've encrypted my SQLite3 db by Navicat ! :
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
but also didn't work
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.
@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 ?
Looks like you might be lucky. QtCipherSqlitePlugin.might be what you need.
@SGaist thx :)
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?
This post is deleted!