10

We'd like to use Room in the application we are developing, but we need to encrypt the database. I know that there was SQLCipher in order to encrypt an SQL database (although I have never used it), but I think that it does not support API level 16 and higher methods, so I think that Room is not supported. On the other hand, there's Realm that supports encryption, but I would really like to use Room instead. How could we encrypt the database then?

Thanks a lot

EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
FVod
  • 2,245
  • 5
  • 25
  • 52

1 Answers1

11

I think that it does not support API level 16 and higher methods, so I think that Room is not supported

Well, so far, my CWAC-SafeRoom library is holding up, though the testing on it has been light so far. It will get more of a workout in the coming months.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    Where has it gotten so far? – Aryeetey Solomon Aryeetey Feb 03 '18 at 11:47
  • @SulaimanJuniorAryeetey: I do not know what you mean. Please read [the project documentation](https://github.com/commonsguy/cwac-saferoom) to learn more about the project. – CommonsWare Feb 03 '18 at 11:48
  • Can I use it in production now? – Aryeetey Solomon Aryeetey Feb 04 '18 at 09:34
  • 1
    @SulaimanJuniorAryeetey: I can't really answer that. There isn't much code, and I haven't had much problem with what is there. However, there are several places where I cannot fulfill the support database API contract, because SQLCipher does not give me the hooks to do so. Eventually, I hope that I can work with the SQLCipher team to fill those gaps. However, so far, it seems like that everything that Room uses I can support. – CommonsWare Feb 04 '18 at 13:31
  • @CommonsWare ihave an app using room to store 1000+ user data i want to encrypt this database.In the description you mentioned that project is for experimentation purposes.should i take the risk?? – EL TEGANI MOHAMED HAMAD GABIR Dec 29 '18 at 16:41
  • @ALTegani: Start with [the 1.0.0 series](https://github.com/commonsguy/cwac-saferoom/blob/master/README-1.0.0.md). Right now, SafeRoom is at `1.0.0-alpha3`, and I should be progressing through a beta to a final `1.0.0` by the end of January. However, in terms of whether or not it it suitable for your project, that is for you to decide. If you run into problems, file an issue with a reproducible test case, and I can work on fixing it. – CommonsWare Dec 29 '18 at 16:48
  • You can use SQLcipher. it supports Room Database. check this Link https://github.com/sqlcipher/android-database-sqlcipher#using-sqlcipher-for-android-with-room – Shohel Rana Jan 15 '20 at 12:55