The goal of my project was to implement Matrix's end-to-end encryption protocol in Python, as part of matrix-python-sdk.
My work is spread across 31 PRs, which can be found here.
Those in direct relation to the project are tagged [E2E]
, while the others are general improvements to the SDK.
At the time of writing, 5 [E2E]
PRs are merged among 16. The last PR is matrix-org/matrix-python-sdk#271.
Some of the main PRs are:
- Base layout, signing and verifying objects matrix-org/matrix-python-sdk#224
- Uploading keys matrix-org/matrix-python-sdk#233
- Device tracking matrix-org/matrix-python-sdk#238
- Olm encryption matrix-org/matrix-python-sdk#239
- Outbound Group Session support matrix-org/matrix-python-sdk#240
- Inbound Group Session support matrix-org/matrix-python-sdk#241
- Key persistence matrix-org/matrix-python-sdk#243
- Additional features such as encrypted attachments, device verification and key sharing.
In order to test the implementation under real conditions, I also wrote a small bot https://github.com/Zil0/matrix-list-bot.
I also contributed to documentation. Those PRs can be found here, and another one is here.
The project is finished, although a significant part is still awaiting review.
Among the 5687 new lines I added to the project as reported by Git, 985 are already merged.
Out of those lines, 1803 are tests. All the code I wrote, located in a new crypto/
subdirectory of the main module matrix_client
, reports 100% branch coverage.
I will address PR review comments. Generally, I will try to help maintain the SDK, since I became the main contributor.
Lastly, end-to-end encryption in a decentralized protocol leads to many tricky edge cases. I may have missed some of those, and they are likely to be found when more people try out the code.
It is already possible to try out the code, which I have already successfully tested in production. Instructions can be found in the issue requesting end-to-end encryption support matrix-org/matrix-python-sdk#100.
I have written a blogpost summarizing my experience, available on Matrix offictial blog https://matrix.org/blog/2018/08/01/gsoc-implementing-end-to-end-encryption-in-the-matrix-python-sdk/.
Thanks to my mentors Richard van der Hoff (richvdh) and Hubert Chathi (uhoreg) for their help (and allowing me to work on this in the first place!). And a special thanks to Adam Beckmeyer (non-Jedi) for reviewing my PRs in his free time.