Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for E2E encryption #106

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DeerMaximum
Copy link

This PR contains a proof of concept for E2E support.
For this, a session store must be created and the E2E room keys imported.
In order for the messages to be displayed as secure, the session must be verified by all recipients.

Related to #32

Note

The decision whether to activate encryption must be passed to the program at the first start.
Changing (de)activation of the encryption afterwards is not supported.

Breaking changes

  • Login via access token is no longer possible.

Program modes

The program can be executed in two modes, run and verify. In run mode the program is executed as usual and a webhook is provided.
In verify mode, the session can be verified interactively via emojis to classify the messages as trustworthy.

Important

In verification mode, the matrix id must be specified completely, otherwise the verification will fail.
Eg: @test:matrix.org

New command-line parameters

--mode

This parameter is used to switch between verification and normal program.
It accepts two options run and verify.

Default: run

--storage

This parameter specifies the path where the session storage is located.

Default: ./storage

--key-password

This parameter contains the password for the E2E room keys.

--encryption

This parameter specifies whether encryption is enabled.

Folder structure of the session storage

├── session-storage
    ├── element-keys.txt
    ├── data.json

Files

In this folder, apart from the ones listed below, matrix-nio creates additional files that allow you to send encrypted messages.

element-keys.txt

This file contains the room keys exported by Matrix. Here a tutorial on how to export these keys.

data.json

This file contains the access token, the device ID and the status whether encryption has been enabled.

@DeerMaximum DeerMaximum marked this pull request as draft September 6, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant