Closed gousaiyang closed 3 years ago
According to https://github.com/sqlcipher/sqlcipher/commit/e4b66d6cc8a2b7547a32ff2c3ac52f148eba3516,
setting cipher_compatibility=1
should have the same effect of setting cipher_use_hmac=off, kdf_iter=4000
.
Does your sqlcipher version include the above commit? If so, it's strange why this would happen.
OK maybe this is the problem. I got SQLCipher via apt install libsqlcipher-dev
and the version is 3.4.1-1build1
, while the commit you mentioned was released since version 4.0.1
. Probably it will be good if I build SQLCipher from source.
I should read your README.md
more carefully as it already said sqlcipher >= 4.1
. Thanks!
I just added a check for version.
Would be nice to also fallback to the old params when using old versions.
Hi, I want to share a potential decryption compatibility problem. Initially your
decrypt-db.py
did not successfully decrypt myEnMicroMsg.db
, so I thought my key was wrong and ended up using SQLCipher-Password-Cracker-OpenCL to brute force the key. Surprisingly, the result is that my original key (md5('1234567890ABCDEF' + uin)[:7]
) was exactly the correct key and I didn't really have to brute force. So the problem is that yourdo_decrypt
function didn't successfully decrypt the DB even when the key is correct, while the relevant function inSQLCipher-Password-Cracker-OpenCL
can decrypt the DB when the correct key is given.I used the following code to reproduce on my DB:
The code above can decrypt my DB. For the two lines
PRAGMA cipher_use_hmac = OFF
andPRAGMA kdf_iter = ...
, if I comment out either one of them, it will fail withpysqlcipher3.dbapi2.DatabaseError: file is encrypted or is not a database
. Probably this is a compatibility problem of SQLite. Anyway, thanks for developing this tool!