
MVP JDBC wrapper around SQLCipher offering a JNI-backed custom JDBC driver, unified API, native bridge, build tooling, and CI-friendly encrypted DB samples.
SQLCipher Multiplatform is a Kotlin Multiplatform library that brings encrypted SQLite support to KMP projects. It unifies database access across Android and JVM, using SQLCipher under the hood, and ships with a JNI-backed JDBC driver for desktop and backend JVM environments
jdbc:sqlcipher:)repositories {
google()
mavenCentral()
}
val sqlcipherVersion = "<latest-version>"
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.s0d3s:sqlcipher-multiplatform:$sqlcipherVersion")
}
}
}dependencies {
implementation("io.github.s0d3s:sqlcipher-multiplatform-jdbc-<platform>:<latest-version>")
}
platformis combination of platform name + architecture: (linux|macos|windows)-(x64|arm64)
import io.github.s0d3s.sqlcipher.multiplatform.api.SqlCipherDatabaseFactory
SqlCipherDatabaseFactory.initialize() // JVM no-op; on Android pass applicationContext
val db = SqlCipherDatabaseFactory.open("app.db", "my-secret-key")
db.execute("CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, text TEXT NOT NULL)")
db.execute("INSERT INTO notes(text) VALUES ('hello')")
val rows = db.querySingleColumn("SELECT text FROM notes ORDER BY id")
println(rows) // [hello]
db.close()Executable examples live in:
samples/kmp-basic-app — direct KMP API usage (SqlCipherDatabaseFactory)samples/kmp-sqldelight-app — SQLDelight on top of SQLCipher JDBCRun sample checks:
./gradlew :samples:kmp-basic-app:verifySample
./gradlew :samples:kmp-sqldelight-app:verifySample
./gradlew verifySamplessqlcipher-multiplatform/ — KMP library API (commonMain, jvmMain, androidMain)sqlcipher-multiplatform-jdbc-core/ — custom JDBC driver (jdbc:sqlcipher:)native-bridge/ — JNI + CMake bridge to SQLCipher/OpenSSLnative-artifacts/ — platform-native runtime packaging modulessamples/ — runnable verification examplesthird_party/sqlcipher/ — SQLCipher amalgamation and upstream submoduleInstall Conan 2 and initialize profile once:
python -m pip install conan
conan profile detect --forcegit submodule update --init --recursive third_party/sqlcipher/upstream
./gradlew updateSqlcipherAmalgamation
./gradlew :native-bridge:buildNative
./gradlew :sqlcipher-multiplatform-jdbc-core:nativeSmokeTest
./gradlew verifySamplessqlcipher/sqlcipher, which are distributed under a BSD-style license. Please review upstream licensing terms when redistributing binaries.SQLCipher Multiplatform is a Kotlin Multiplatform library that brings encrypted SQLite support to KMP projects. It unifies database access across Android and JVM, using SQLCipher under the hood, and ships with a JNI-backed JDBC driver for desktop and backend JVM environments
jdbc:sqlcipher:)repositories {
google()
mavenCentral()
}
val sqlcipherVersion = "<latest-version>"
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.s0d3s:sqlcipher-multiplatform:$sqlcipherVersion")
}
}
}dependencies {
implementation("io.github.s0d3s:sqlcipher-multiplatform-jdbc-<platform>:<latest-version>")
}
platformis combination of platform name + architecture: (linux|macos|windows)-(x64|arm64)
import io.github.s0d3s.sqlcipher.multiplatform.api.SqlCipherDatabaseFactory
SqlCipherDatabaseFactory.initialize() // JVM no-op; on Android pass applicationContext
val db = SqlCipherDatabaseFactory.open("app.db", "my-secret-key")
db.execute("CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, text TEXT NOT NULL)")
db.execute("INSERT INTO notes(text) VALUES ('hello')")
val rows = db.querySingleColumn("SELECT text FROM notes ORDER BY id")
println(rows) // [hello]
db.close()Executable examples live in:
samples/kmp-basic-app — direct KMP API usage (SqlCipherDatabaseFactory)samples/kmp-sqldelight-app — SQLDelight on top of SQLCipher JDBCRun sample checks:
./gradlew :samples:kmp-basic-app:verifySample
./gradlew :samples:kmp-sqldelight-app:verifySample
./gradlew verifySamplessqlcipher-multiplatform/ — KMP library API (commonMain, jvmMain, androidMain)sqlcipher-multiplatform-jdbc-core/ — custom JDBC driver (jdbc:sqlcipher:)native-bridge/ — JNI + CMake bridge to SQLCipher/OpenSSLnative-artifacts/ — platform-native runtime packaging modulessamples/ — runnable verification examplesthird_party/sqlcipher/ — SQLCipher amalgamation and upstream submoduleInstall Conan 2 and initialize profile once:
python -m pip install conan
conan profile detect --forcegit submodule update --init --recursive third_party/sqlcipher/upstream
./gradlew updateSqlcipherAmalgamation
./gradlew :native-bridge:buildNative
./gradlew :sqlcipher-multiplatform-jdbc-core:nativeSmokeTest
./gradlew verifySamplessqlcipher/sqlcipher, which are distributed under a BSD-style license. Please review upstream licensing terms when redistributing binaries.