Android room encrpytion

3.1k Views Asked by At

How do we achieve encryption using the Android Room library. I found this library:

https://github.com/commonsguy/cwac-saferoom

However, I can't find a complete example as to how to implement Room with CWAC-Saferoom for encryption purposes. Also

  1. Does the CWAC-Saferoom use 512 bit encryption key for the database?
  2. And how is the database encrypted itself?

Are there any other alternatives that i can use for encrypting database on Android which use maybe 512/1024 bit encryption?

1

There are 1 best solutions below

6
CommonsWare On

However, I can't find a complete example as to how to implement Room with CWAC-Saferoom for encryption purposes

There is a demo/ app in the project.

Does the CWAC-Saferoom use 512 bit encryption key for the database?

CWAC-SafeRoom does not perform encryption. Its classes connect Room with SQLCipher for Android, a version of SQLite that offers transparent encryption of its contents. Please consult the SQLCipher documentation for questions about SQLCipher.

And how is the database encrypted itself?

This is covered in the SQLCipher documentation.

Are there any other alternatives that i can use for encrypting database on Android which use maybe 512/1024 bit encryption?

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.