A Dart implementation of the cryptography needed for OMEMO 0.8.3.
Go to file
Alexander "PapaTutuWawa 438012d8f8 fix: Hopefully fix all tests being flaky
It seems that the varint encoding function would not work for
some integers as input. This should in theory fix this issue. Since
the SPK IDs are randomly between 0 and 2**32 - 1, it makes sense that
the tests fail only sometimes.
2022-09-14 23:50:54 +02:00
example feat: Add getDeviceId and getDeviceBundle 2022-08-18 15:30:31 +02:00
lib fix: Hopefully fix all tests being flaky 2022-09-14 23:50:54 +02:00
protobuf wip: Add the basics for the Double Ratchet 2022-08-02 18:13:14 +02:00
test fix: Hopefully fix all tests being flaky 2022-09-14 23:50:54 +02:00
.gitignore docs: Add notes on protobuf 2022-08-09 16:00:12 +02:00
.gitlint style: Fix linter warnings 2022-08-16 13:46:08 +02:00
analysis_options.yaml wip: Add the basics for the Double Ratchet 2022-08-02 18:13:14 +02:00
CHANGELOG.md release: Bump version 2022-08-19 17:00:44 +02:00
flake.lock refactor: Clean up the X3DH implementation 2022-08-02 15:03:58 +02:00
flake.nix wip: Add the basics for the Double Ratchet 2022-08-02 18:13:14 +02:00
LICENSE release: Make pub happy 2022-08-09 16:02:20 +02:00
pubspec.yaml chore: Lower meta's minimum version 2022-09-09 17:40:16 +02:00
README.md docs: Update README 2022-08-18 15:35:07 +02:00

omemo_dart

omemo_dart is a Dart library to help developers of Dart/Flutter XMPP clients to implement OMEMO in its newest version - currently 0.8.3.

The library provides an implementation of the X3DH key exchange, the Double Ratchet with the OMEMO 0.8.3 specific ENCRYPT, DECRYPT and KDF_* functions and a very high-level OmemoSessionManager that manages all Double Ratchet sessions and provides a clean and simple interface for encrypting a message for all known Ratchet sessions we have with a user.

This library also has no dependency on any XMPP library. omemo_dart instead defines an intermediary format for the required data that you, the user, will need to transform to and from the stanza format of your preferred XMPP library yourself.

Important Notes

  • Please note that this library has not been audited for its security! Use at your own risk!
  • This library is not tested with other implementations of OMEMO 0.8.3 as I do not know of any client implementing spec compliant OMEMO 0.8.3. It does, however, work with itself.

Usage

Include omemo_dart in your pubspec.yaml like this:

# [...]

dependencies:
  omemo_dart:
    hosted: https://git.polynom.me/api/packages/PapaTutuWawa/pub
    version: ^0.2.0
  # [...]

# [...]

Contributing

Due to issues with protobuf, omemo_dart reimplements the Protobuf encoding for the required OMEMO messages. As such, protobuf is only a dependency for testing that the serialisation and deserialisation of the custom implementation. In order to run tests, you need the Protbuf compiler. After that, making sure that the Dart Protobuf compiler addon and the Protobuf compiler itself is in your PATH, run protoc -I=./protobuf/ --dart_out=lib/protobuf/ ./protobuf/schema.proto in the repository's root to generate the real Protobuf bindings.

When submitting a PR, please run the linter using dart analyze and make sure that all tests still pass using dart test.

To ensure uniform commit message formatting, please also use gitlint to lint your commit messages' formatting.

License

Licensed under the MIT license.

See LICENSE.