How to encrypt the database when using Room?
Asked Answered
D

1

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

Delainedelainey answered 10/7, 2017 at 9:23 Comment(1)
F
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.

Foulup answered 10/7, 2017 at 14:20 Comment(7)
Where has it gotten so far?Yecies
@SulaimanJuniorAryeetey: I do not know what you mean. Please read the project documentation to learn more about the project.Foulup
Can I use it in production now?Yecies
@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.Foulup
@Foulup 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??Oospore
@ALTegani: Start with the 1.0.0 series. 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.Foulup
You can use SQLcipher. it supports Room Database. check this Link github.com/sqlcipher/…Inanition

© 2022 - 2024 — McMap. All rights reserved.