0

I need to encrypt sqlite data base file using sqlcipher in java. I tried using sqlcipher.jar, but resulting in compilation problem

The type android.database.Cursor cannot be resolved. It is indirectly referenced from required .class file

Is there any way to encrypt or decrypt sqlite database file using sqlcipher in java?

Bharath Dasararaju
  • 505
  • 1
  • 4
  • 9
  • Just to get this straight: You are on Java (SE?) **not** Android? For Android there are instructions: https://www.zetetic.net/sqlcipher/sqlcipher-for-android/ – Fildor Jun 16 '16 at 11:22
  • I am not using android, its pure java application – Bharath Dasararaju Jun 16 '16 at 11:30
  • 1
    Then you cannot use android.database.Cursor. If sqlcipher references that, you might be forced to look for another lib or a version of it that works with pure Java. – Fildor Jun 16 '16 at 11:32
  • Have a look here: http://stackoverflow.com/a/30662412/982149 – Fildor Jun 16 '16 at 11:35

1 Answers1

0

Don't use sqlcipher.jar, use the gradle for dependencies:

dependencies {
 ...

    implementation 'net.zetetic:android-database-sqlcipher:3.5.9@aar'
}

More details: https://www.zetetic.net/sqlcipher/sqlcipher-for-android/

live-love
  • 48,840
  • 22
  • 240
  • 204