A Dart implementation of the cryptography needed for OMEMO 0.8.3.
Go to file
2023-06-18 12:44:09 +02:00
.github feat: Add funding 2022-12-27 01:47:08 +01:00
example feat: Take care of publishing 2023-06-17 23:14:00 +02:00
lib fix: Remove unused imports 2023-06-17 23:31:16 +02:00
protobuf wip: Add the basics for the Double Ratchet 2022-08-02 18:13:14 +02:00
test feat: Remove unused helper functions 2023-06-17 23:27:10 +02:00
.gitignore chore: Commit the protobuf artifacts 2022-09-18 15:56:09 +02:00
.gitlint style: Fix linter warnings 2022-08-16 13:46:08 +02:00
.pubignore chore: Let pub ignore the protobuf build artifacts 2022-09-29 15:24:33 +02:00
.woodpecker.yml ci: Fix issue with duplicate naming 2022-09-28 13:18:39 +02:00
analysis_options.yaml feat: Move the result type into moxlib 2023-06-17 21:22:16 +02:00
CHANGELOG.md fix: Fix some issues found by integrating 2023-06-17 20:32:06 +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 feat: Move the result type into moxlib 2023-06-17 21:22:16 +02:00
README.md docs: Add missing note about OmemoDevice 2023-06-18 12:44:09 +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.5.0
  # [...]

# [...]

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:

  • The OmemoDevice assigned to the OmemoManager
  • JID -> [int]: The device list for each JID
  • (JID, device) -> Ratchet: The actual ratchet

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

  • (JID, device) -> (int, bool): The trust level and the enablement state

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.