Use 'net.zetetic:android-database-sqlcipher:3.5.6@aar' open 1x.db


#1

Hello,I used v3.5.6 open 1x.db database,the password is true,Why is it wrong?What should I do?Thanks


The following error occurred at run time
"net.sqlcipher.database.SQLiteException: file is encrypted: or is not a database"


#2


#3

@lovezmcs What version of SQLCipher created 1x.db?


#4

Hi,I used your Demo,the url ‘https://github.com/sqlcipher/sqlcipher-android-tests/blob/master/src/main/java/net/zetetic/tests/AttachExistingDatabaseTest.java


#5

The db file ‘https://github.com/sqlcipher/sqlcipher-android-tests/tree/master/assets


#6

@lovezmcs. In that case you would also need to disable HMAC in your postKey:

https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_use_hmac


#7

Hi @lovezmcs

If you are attempting to access a 1.x database file, not only would you need to adjust the KDF iteration length as you are, you will also need to disable the HMAC page checking behavior the newer versions of the library perform. Please see this for reference. Alternatively, we would recommend utilizing the PRAGMA cipher_migrate; option within the postKey event of your database hook, an example can be found here.


#8

Thanks,I tried it


I don’t want to use the’PRAGMA cipher_migrate; 'because it will make the old project can’t run, what should I do?


#9

Thanks,I don’t want to use the’PRAGMA cipher_migrate; 'because it will make the old project can’t run, what should I do?


#10

If you’re using postKey use Pragma kdf_iter instead of cipher_default_kdf_iter.


#12

Thanks so much,now is ok.You are a good man…