Skip to content

Encrypt backups written into file #7743

@link2xt

Description

@link2xt

Backups are currently unencrypted. Secure way to transfer backups is over the network using the backup transfer function ("Add second device" in the UIs). When it does not work, users export the backups which stores to Downloads folder on Android, see forum topic. See also https://support.delta.chat/t/researching-a-zero-trust-storage-layer-for-deltachat-core-rust-thoughts/4554/7

rPGP crate that we use supports streaming encryption and decryption with AEAD modes of the latest standard of OpenPGP. Mandatory to implement AEAD mode is OCB, so encrypted backup format should likely be an OpenPGP binary message with an SKESK packet (with Argon2 which is also supported) followed by SEIPD v2 in OCB mode. We already have a function to export backups into streams, this is used both when exporting into files and when exporting over the network when "Add second device" procedure is used:

async fn export_backup(context: &Context, dir: &Path, passphrase: String) -> Result<()> {

We definitely don't want users to provide their own passwords in the UIs, and don't want each UIs to have its own code to generate passwords. Passwords should be generated by the application as a string of digits separated by -, similar to Autocrypt Setup Message or Signal passwords for backups.

I have not figured out API details, but one way is to have a separate API to generate the password and then UI can pass it back to backup API after displaying the password to the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions