# Local encryption \[protected database storage at rest\]

**URL:** <https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394>\
**Category:** Feature Proposal\
**Tags:** security\
**Created:** [April 30, 2019, 9:04pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394 "2019-04-30T21:04:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Infinity](https://forum.delta.chat/letter_avatar_proxy/v4/letter/i/a587f6/32.png) [@Infinity](https://forum.delta.chat/u/Infinity)\
**Post date:** [April 30, 2019, 9:04pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/1 "2019-04-30T21:04:49Z")

</div>

Please, implement encryption of attachments and text messages while they are stored locally on the device. Apps with root access can read unencrypted text and see attachments. For instance, look how it is done in Signal and may be Threema (which is not open source). Is it possible?

---

<div class="post-metadata">

**Author:** ![r10s](https://forum.delta.chat/user_avatar/forum.delta.chat/r10s/32/1513_2.png) [@r10s](https://forum.delta.chat/u/r10s)\
**Post date:** [May 1, 2019, 12:31pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/2 "2019-05-01T12:31:05Z")

</div>

sure it is possible, however, it has to be done anyway 🙂 however, afaik, there are also some issues filed for that.

wanted to note here that the “apps with root access” cannot be run on a “normal” unrooted phone. so it is not a general issue.

---

<div class="post-metadata">

**Author:** ![Mannshoch](https://forum.delta.chat/user_avatar/forum.delta.chat/mannshoch/32/98_2.png) [@Mannshoch](https://forum.delta.chat/u/Mannshoch)\
**Post date:** [May 2, 2019, 9:21am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/3 "2019-05-02T09:21:03Z")

</div>

I like this Idea, my personal problem is, that I need the Mails not encrypted on server because of Outlook and other Thunderbird Installation. If you plan to encrypt files on phone than they have to be per device without any effect on the situation inside the app.

---

<div class="post-metadata">

**Author:** ![gerryfrancis](https://forum.delta.chat/user_avatar/forum.delta.chat/gerryfrancis/32/1771_2.png) [@gerryfrancis](https://forum.delta.chat/u/gerryfrancis)\
**Post date:** [January 2, 2020, 2:43pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/4 "2020-01-02T14:43:07Z")

</div>

Another vote to encrypt the database, a simple password without use of PGP would do for me. Thanks!

---

<div class="post-metadata">

**Author:** ![enacting](https://forum.delta.chat/user_avatar/forum.delta.chat/enacting/32/512_2.png) [@enacting](https://forum.delta.chat/u/enacting)\
**Post date:** [January 31, 2020, 8:32am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/5 "2020-01-31T08:32:24Z")

</div>

Or ask your mail provider to improve remote content storage

> **[Sign in](https://0xacab.org/users/sign_in)**
>
> 0xacab

---

<div class="post-metadata">

**Author:** ![zgzgng](https://forum.delta.chat/user_avatar/forum.delta.chat/zgzgng/32/529_2.png) [@zgzgng](https://forum.delta.chat/u/zgzgng)\
**Post date:** [February 5, 2020, 9:55am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/6 "2020-02-05T09:55:49Z")

</div>

Is TREES different than dovecoat plugin crypt

[https://doc.dovecot.org/configuration\_manual/mail\_crypt\_plugin/](https://doc.dovecot.org/configuration_manual/mail_crypt_plugin/)

---

<div class="post-metadata">

**Author:** ![link2xt](https://forum.delta.chat/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@link2xt](https://forum.delta.chat/u/link2xt)\
**Post date:** [March 2, 2020, 1:29am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/7 "2020-03-02T01:29:50Z")

</div>

[Rust crate Delta.Chat uses for SQLite](https://lib.rs/crates/rusqlite) supports [SQLCipher](https://www.zetetic.net/sqlcipher/).

> For instance, look how it is done in Signal and may be Threema (which is not open source). Is it possible?

Signal uses SQLCipher: [Signal \>\> Blog \>\> Storage management for Signal Android](https://signal.org/blog/storage-management-for-android/)

[Delta.Chat](http://Delta.Chat) could probably migrate to SQLCipher too. However, attachments are currently stored outside the database, in so-called “blob directory”. It should be moved into the database to take advantage of encryption.

---

<div class="post-metadata">

**Author:** ![WofWca](https://forum.delta.chat/user_avatar/forum.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://forum.delta.chat/u/WofWca)\
**Post date:** [May 14, 2025, 8:41am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/8 "2025-05-14T08:41:32Z")

</div>

For reference, Molly (Signal fork) on Android does implement database encryption:

> **[Data Encryption At Rest](https://github.com/mollyim/mollyim-android/wiki/Data-Encryption-At-Rest)**
>
> Enhanced and security-focused fork of Signal. Contribute to mollyim/mollyim-android development by creating an account on GitHub.

AFAIK its entire purpose is to be a more secure Signal.

---

<div class="post-metadata">

**Author:** ![WofWca](https://forum.delta.chat/user_avatar/forum.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://forum.delta.chat/u/WofWca)\
**Post date:** [May 14, 2025, 8:53am UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/9 "2025-05-14T08:53:37Z")

</div>

Also another option, that a user could try to implement by hand, is using a “Vault” software like [Cryptomator](https://cryptomator.org). It mounts a virtual drive that you can access as a regular drive, but the data is stored in encrypted form.  
So, one could set the accounts dir to be inside that drive, thus requiring you to unlock the vault before you can use Delta Chat.

If this proves to work we could perhaps more tightly integrate it with Delta Chat, i.e. to manage locking / unlocking (as opposed to just saying “path does not exist” if the vault is not locked). But this is just me speaking my mind, maybe it’s better to see how others do it (I am not aware of much apps that implement local encryption, besides password managers).

---

<div class="post-metadata">

**Author:** ![DELTA\_MAFIA](https://forum.delta.chat/user_avatar/forum.delta.chat/delta_mafia/32/2624_2.png) [@DELTA\_MAFIA](https://forum.delta.chat/u/DELTA_MAFIA)\
**Post date:** [May 22, 2025, 5:42pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/10 "2025-05-22T17:42:53Z")

</div>

And if you take Windows, then you don’t even need root there, haha, everything in the blob is open.

---

<div class="post-metadata">

**Author:** ![peppa](https://forum.delta.chat/letter_avatar_proxy/v4/letter/p/da6949/32.png) [@peppa](https://forum.delta.chat/u/peppa)\
**Post date:** [May 23, 2025, 3:44pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/11 "2025-05-23T15:44:04Z")

</div>

> [@WofWca](#):
>
> maybe it’s better to see how others do it (I am not aware of much apps that implement local encryption

Briar implements local encryption. I’m not sure what they use.

---

<div class="post-metadata">

**Author:** ![stek29](https://forum.delta.chat/user_avatar/forum.delta.chat/stek29/32/3250_2.png) [@stek29](https://forum.delta.chat/u/stek29)\
**Post date:** [March 12, 2026, 11:42pm UTC](https://forum.delta.chat/t/local-encryption-protected-database-storage-at-rest/394/12 "2026-03-12T23:42:58Z")

</div>

I think this is more of an issue on desktop apps. sqlcrypt might be a solution for full encryption of the local database, with a KDF relying on a password and/or key stored in OS keychain.

UPD: turns out it was discussed in a different thread: [Researching a 'Zero-Trust' storage layer for deltachat-core-rust — thoughts? - #6 by link2xt](https://support.delta.chat/t/researching-a-zero-trust-storage-layer-for-deltachat-core-rust-thoughts/4554/6)
