<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0" -->

---
title: Multiplatform Encryption with SQLDelight and SQLCipher
description: A walkthrough of integrating SQLCipher encryption into a Kotlin Multiplatform project using SQLDelight and SQLiter. Key findings include disabling the...
canonical: https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Multiplatform Encryption with SQLDelight and SQLCipher | daily.dev
og:description: A walkthrough of integrating SQLCipher encryption into a Kotlin Multiplatform project using SQLDelight and SQLiter. Key findings include disabling the...
og:url: https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0
og:image: https://api.daily.dev/og/posts/bENf1VIr0.png
og:image:alt: Multiplatform Encryption with SQLDelight and SQLCipher
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Multiplatform Encryption with SQLDelight and SQLCipher

**[Touchlab](https://daily.dev/sources/touchlab)** · 4 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of integrating SQLCipher encryption into a Kotlin Multiplatform project using SQLDelight and SQLiter. Key findings include disabling the linkSqlite flag to prevent automatic vanilla SQLite3 linking, and using a static framework with CocoaPods to cleanly add SQLCipher as a pod dependency. The post also uncovers an undocumented iOS behavior where the platform's bundled SQLite3 appears to include SQLite Encryption Extensions, which can mislead developers into thinking their custom encryption library is active when it isn't.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://touchlab.co/multiplatform-encryption-with-sqldelight-and-sqlcipher>

## Questions this post answers

### How do I make sure SQLCipher, not the default sqlite3, gets linked in a Kotlin Multiplatform SQLDelight project on iOS?

Set the linkSqlite flag to false in the SQLDelight database configuration block, since it defaults to true and adds sqlite3 to the linker flags, causing vanilla sqlite3 to link instead of SQLCipher when building a dynamic framework. Alternatively, compile a static framework, which avoids the conflict entirely and was the approach ultimately used.

_daily.dev surfaces practical fixes like this for developers wiring encryption into Kotlin Multiplatform builds._

### Why does my SQLite database on iOS appear encrypted even though I never configured SQLCipher?

The sqlite3 copy shipped on iOS includes SQLite Encryption Extensions (SEE), which responds to the key pragma even without an explicit encryption library configured. Since SEE requires a license and Apple's use of it is undocumented, relying on this behavior is risky; developers should verify their intended encryption library, like SQLCipher, is actually being used rather than this undocumented iOS behavior.

_track subtle platform quirks like undocumented iOS sqlite3 encryption behavior via daily.dev before they surprise your team._

### How do I add SQLCipher as a dependency to a Kotlin Multiplatform iOS project?

Add SQLCipher as a CocoaPods dependency (version ~> 4.0) inside a static framework configuration, using the cocoapodsext block with pod("SQLCipher", "~> 4.0") and framework { isStatic = true }. This handles the CInterop automatically and satisfies SQLiter's requirements; encryption was confirmed by decrypting the resulting database with the SQLCipher CLI.

_developers wiring native encryption into KMP builds can find setups like this through daily.dev._

## Similar posts on daily.dev

- [SQLite Across Every Port: One Contract, One Encrypted File Format](https://daily.dev/posts/sqlite-across-every-port-one-contract-one-encrypted-file-format-pohxsagfo) · Foojay.io · 1 upvotes · 0 comments
- [Goodbye EncryptedSharedPreferences: A 2026 Migration Guide](https://daily.dev/posts/goodbye-encryptedsharedpreferences-a-2026-migration-guide-u7qca7ln0) · droidcon · 1 upvotes · 1 comments

---

Tags: [#kotlin](https://daily.dev/tags/kotlin), [#sqlite](https://daily.dev/tags/sqlite), [#cocoapods](https://daily.dev/tags/cocoapods)

[View this post on daily.dev](https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Multiplatform Encryption with SQLDelight and SQLCipher","url":"https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0"},"datePublished":"2026-08-02T07:15:31.345Z","dateModified":"2026-09-14T06:39:59.795Z","description":"A walkthrough of integrating SQLCipher encryption into a Kotlin Multiplatform project using SQLDelight and SQLiter. Key findings include disabling the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8c56c4f68ad8a4c0ae547c001b26b4ac?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8c56c4f68ad8a4c0ae547c001b26b4ac?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Touchlab","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Touchlab","logo":"https://media.daily.dev/image/upload/s--CQ0u6GwB--/f_auto,q_auto/v1785654902/logos/touchlab?_a=BAMAMicg0","url":"https://daily.dev/sources/touchlab"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kotlin,sqlite,cocoapods","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Touchlab","item":"https://daily.dev/sources/touchlab"},{"@type":"ListItem","position":3,"name":"Multiplatform Encryption with SQLDelight and SQLCipher"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/multiplatform-encryption-with-sqldelight-and-sqlcipher-benf1vir0#faq","mainEntity":[{"@type":"Question","name":"How do I make sure SQLCipher, not the default sqlite3, gets linked in a Kotlin Multiplatform SQLDelight project on iOS?","acceptedAnswer":{"@type":"Answer","text":"Set the linkSqlite flag to false in the SQLDelight database configuration block, since it defaults to true and adds sqlite3 to the linker flags, causing vanilla sqlite3 to link instead of SQLCipher when building a dynamic framework. Alternatively, compile a static framework, which avoids the conflict entirely and was the approach ultimately used. daily.dev surfaces practical fixes like this for developers wiring encryption into Kotlin Multiplatform builds."}},{"@type":"Question","name":"Why does my SQLite database on iOS appear encrypted even though I never configured SQLCipher?","acceptedAnswer":{"@type":"Answer","text":"The sqlite3 copy shipped on iOS includes SQLite Encryption Extensions (SEE), which responds to the key pragma even without an explicit encryption library configured. Since SEE requires a license and Apple's use of it is undocumented, relying on this behavior is risky; developers should verify their intended encryption library, like SQLCipher, is actually being used rather than this undocumented iOS behavior. track subtle platform quirks like undocumented iOS sqlite3 encryption behavior via daily.dev before they surprise your team."}},{"@type":"Question","name":"How do I add SQLCipher as a dependency to a Kotlin Multiplatform iOS project?","acceptedAnswer":{"@type":"Answer","text":"Add SQLCipher as a CocoaPods dependency (version ~> 4.0) inside a static framework configuration, using the cocoapodsext block with pod(\"SQLCipher\", \"~> 4.0\") and framework { isStatic = true }. This handles the CInterop automatically and satisfies SQLiter's requirements; encryption was confirmed by decrypting the resulting database with the SQLCipher CLI. developers wiring native encryption into KMP builds can find setups like this through daily.dev."}}]}
```

