I'm trying to encrypt the KMP's room DB for androi...
# multiplatform
m
I'm trying to encrypt the KMP's room DB for android and iOS using SQLCipher. For android, I can get it done by the openHelperFactory
Copy code
internal fun getDatabaseBuilder(app: Application): RoomDatabase.Builder<MyDatabase> {
    val passphrase: ByteArray = SQLiteDatabase.getBytes("temp_passphrase".toCharArray())
    val factory = SupportFactory(passphrase)
    val dbFile = app.getDatabasePath(KMPConstants.DB_FILE_NAME)
    return Room.databaseBuilder<MyDatabase>(
        context = app,
        name = dbFile.absolutePath,
    )
        .openHelperFactory(factory)
}
How do I do it for iOS?
Currently you can't encrypt room DB in iOS using SQLCipher. Does anyone have any idea on how to do it myself? Or should I just wait for SQLCipher to support it? https://discuss.zetetic.net/t/sqlcipher-encryption-not-applied-to-room-database-for-ios/6875?u=moejoemj
p
For that I think you have to check the internal implementation of IOS side in Room library.
then only you can conclude that.
h
I am also interest to know. any one has idea about this? and how to achieve this task?