PapaTutuWawa / omemo_dart

A Dart implementation of the cryptography needed for OMEMO 0.8.3 (mirror)
https://codeberg.org/PapaTutuWawa/omemo_dart
MIT License
16 stars 1 forks source link
cryptography dart double-ratchet flutter omemo x3dh xmpp

omemo_dart

status-badge

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

Usage

Include omemo_dart in your pubspec.yaml like this:

# [...]

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

# [...]

Example

This repository includes a documented "example" that explains the basic usage of the library while leaving out the XMPP specific bits. For a more functional and integrated example, see the omemo_client.dart example from moxxmpp.

Persistence

By default, omemo_dart uses in-memory implementations for everything. For a real-world application, this is unsuitable as OMEMO devices would be constantly added. In order to allow persistence, your application needs to keep track of the following:

If you also use the BlindTrustBeforeVerificationTrustManager, you additionally need to keep track of:

Contributing

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.

Support

If you like what I do and you want to support me, feel free to donate to me on Ko-Fi.