opened
JulioV
username_0
I can't decrypt a database created in Android on Linux. I'm using this command:

`PRAGMA key='abcde';ATTACH DATABASE '/home/julio/Desktop/aware.db' AS plaintext KEY '';`

but I get: Error: file is encrypted or is not a database.

My app is working OK so I assume the database is accessible. I'm using the latest version of Android SQLCipher (compile 'net.zetetic:android-database-sqlcipher:3.5.3@aar') and version 3.11.0 of SQLCipher for Linux (Ubuntu 15.04). I ran PRAGMA cipher_version on the Android app and I got 3.4.0. I ran the test suite for Android and all 53 tests passed.
 
In my android java class I'm importing:
```
import net.sqlcipher.database.SQLiteDatabase;
import net.sqlcipher.database.SQLiteDatabase.CursorFactory;
import net.sqlcipher.database.SQLiteOpenHelper;
```
Before trying the newest Android version I was using an old one. I can't pinpoint which one exactly but it was from when we needed to import icudt46l.zip to assets, commons-codec, guava and sqlcipher.jar to gradle and the .so libraries to the JNI folders.
FIle is encrypted or is not a database
issue
created
sjlombardo
username_1
@username_0 - What do you get back when you run PRAGMA cipher_version on the linux build? 

Are there any other non-default runtime pragmas being used on Android when creating the database, e.g. PRAGMA kdf_iter or PRAGMA cipher_use_hmac?
comment
created
JulioV
username_0
cipher_version on the linux build is 3.4.0. I'm not sure about the other pragmas, if there is something I would need to configure manually I would say no since I  use the default options:

`SQLiteDatabase.openOrCreateDatabase(database_file.getPath(), "abcde",null,null);`

I will try to delete all the old SQLCipher libraries and files.
comment
created
sjlombardo
username_1
@username_0 the two should be compatible. Could you generate a sample database that doesn't contain any sensitive data for us to look at?
comment
created
JulioV
username_0
Sure, here it is: https://ufile.io/ceedb
comment
created
sjlombardo
username_1
@username_0 I was just able to open that database using the SQLCipher 3.4.0 command line tool with the given password.  Can you post the full log of how you are building and opening the file on linux?
comment
created
JulioV
username_0
First I clone SQLCipher:
```
git clone https://github.com/sqlcipher/sqlcipher.git
```
Then I configure it
```
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
    LDFLAGS="-lcrypto"
```
This is the output: http://pastebin.com/nCKPaJUT

Then I make it:
```
make
```
This is the output: http://pastebin.com/fkmJBhw3

I execute it:
```
./sqlcipher
```
then when the sqlite> command line opens I do:
```
PRAGMA key='abcde';ATTACH DATABASE '/home/julio/Desktop/battery.db' AS plaintext KEY '';
```
and I get: Error: file is encrypted or is not a database
comment
created
sjlombardo
username_1
If battery.db is the encrypted database, you need to open it like this

```
./sqlcipher /home/julio/Desktop/battery.db
sqlite> PRAGMA KEY = 'abcde';
sqlite> SELECT * FROM battery;
```
comment
closed
sjlombardo
username_1
issue