Created
June 4, 2022 00:10
-
-
Save ed-george/703002be3904cbbe151d137f37c59383 to your computer and use it in GitHub Desktop.
Unpacking Android Security: Part 2 - Insecure Data Storage (Example 4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use a user-entered passphrase to encrypt/decrypt | |
val passPhrase: ByteArray = "password".encodeToByteArray() | |
val sqlCipherSupportFactory: SupportSQLiteOpenHelper.Factory = SupportFactory(passPhrase) | |
val database = Room.databaseBuilder( | |
applicationContext, | |
YourRoomDatabase::class.java, | |
"secure-database") | |
.openHelperFactory(sqlCipherSupportFactory) | |
.build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment