Question: I'm building an SDK to be used in a hosting app. This SDK includes working with DB using SQLite.

One of the requirements, is that the DB will be encrypted in order to prevent 
pulling the SQLite database from the device and using the user private information.

I started to work with [SQLCipher](https://www.zetetic.net/sqlcipher/), but there is no support for 64bit architecture devices, which causing the application to crash.

I checked some other possibilities, but all of them causing other issues that I decided to try handle it by myself.

My questions:

1. Does Android have some encryption mechanism for DB files?
2. Can I encrypt the file when the application starts, and decrypt it again when the application is closing? I know that in iOS there is some kind of possibility called [NSFileProtection](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/)
3. Do you know other library that can handle the DB encryption, that supports 64bit devices?
4. Do you know if there is an Android solution for this, without using JNI([javax.crypto](http://developer.android.com/reference/javax/crypto/package-summary.html))?

I'll be happy to get any information or help.

Answer: 
> 
> there is no support for 64bit architecture devices
> 
> 
> 

SQLCipher works fine on the 64-bit devices that I have used it on. I seem to recall some issues with some apps that had multiple NDK libraries/code, where some had 64-bit libraries and some did not, where there were issues. I would suggest that you open separate Stack Overflow questions, or use other support resources (e.g., SQLCipher's support board), to get to the bottom of your difficulties.

> 
> Does Android have some encryption mechanism for DB files?
> 
> 
> 

No.

> 
> Can I encrypt the file when the application starts, and decrypt it again when the application is closing?
> 
> 
> 

No, for several reasons, not the least of which is that applications do not close on Android.

> 
> Do you know other library that can handle the DB encryption, that supports 64bit devices?
> 
> 
> 

No, and asking for off-site resources is considered to be off-topic for Stack Overflow, anyway.

> 
> Do you know if there is an Android solution for this, without using JNI(javax.crypto)?
> 
> 
> 

This is the same as the first and third questions.
You need to use the latest version of android-database-sqlcipher [here](https://github.com/sqlcipher/android-database-sqlcipher/releases). Am using 3.5.4 it solved "java.lang.UnsatisfiedLinkError: dlopen failed: library "libutils.so" not found". Please check it [here](https://github.com/ResearchStack/ResearchStack/issues/371)