Skip to content

Encrypt files using AES-256-GCM when using OX#2186

Merged
jubalh merged 2 commits into
masterfrom
feat/ox-sendfile
Jul 5, 2026
Merged

Encrypt files using AES-256-GCM when using OX#2186
jubalh merged 2 commits into
masterfrom
feat/ox-sendfile

Conversation

@jubalh

@jubalh jubalh commented Jul 4, 2026

Copy link
Copy Markdown
Member

Fixes: #2175

jubalh added 2 commits July 4, 2026 22:09
Add support to send encrypted files when in an OX (XEP-0373) session.

When a user has OX encryption enabled in a 1:1 chat window,
invoking `/sendfile` will now trigger local e2e encryption of the file using
AES-256-GCM from XEP-0454 OMEMO media sharing.

The encrypted payload is uploaded to the HTTP Upload (XEP-0363)
component. On successful completion, the download URL is formatted under the
custom `aesgcm://` scheme with the appended IV and key fragment, and transmitted
as a standard OX encrypted signcrypt message.

So this means not only the link to the file is encrypted (OX) but the
file itself is encrypted as well.

The drawback is that now `/sendfile` only works if Profanity is built
with OMEMO support since we use those routines. We might make this
configurable:
* upload encrypted file (omemo) + encrypt link (ox)
* upload plain file + encrypt link (ox)

Fixes: #2175
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Add `/ox encryptfile on|off` command to allow users to toggle local
AES-256-GCM encryption before file upload when using OX.

Enabled by default when compiled with OMEMO support.
Disabled in case we compile with OX but without OMEMO.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Jul 4, 2026
@jubalh jubalh self-assigned this Jul 4, 2026
@jubalh

jubalh commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@mdosch feedback welcome.

@mdosch

mdosch commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

LGTM, tested with gajim.

@jubalh jubalh merged commit 349c3b7 into master Jul 5, 2026
12 checks passed
@jubalh jubalh deleted the feat/ox-sendfile branch July 5, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ox: Support http-upload

2 participants