Skip to content
pubscout

openmls

4.0.0, released 9 days ago by an unverified publisher

Dart wrapper for OpenMLS, a Rust implementation of the Messaging Layer Security (MLS) protocol.

WASM-readyUnverified publisher
$ flutter pub add openmls
Source repository

What it does

Provides secure group messaging, group key agreement, and encrypted state storage using the Messaging Layer Security (MLS) protocol (RFC 9420). It uses a Rust backend integrated via Flutter Rust Bridge to offer cross-platform cryptography and messaging capabilities.

AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need end-to-end encrypted secure group messaging compliant with RFC 9420.
  • You require forward secrecy and post-compromise security in Dart or Flutter applications.
  • You want encrypted at-rest storage for MLS state across native platforms and web.

Skip it when

  • Your target environment relies on the `dart2wasm` build target (not currently supported).
  • You need a simple client-server REST API wrapper rather than complex group key exchange protocols.

Strengths

  • Implements standard-compliant Messaging Layer Security (MLS) via robust Rust bindings.
  • Supports a wide range of platforms including Android, iOS, Web, Windows, macOS, and Linux.
  • Provides automatic encrypted state storage (SQLCipher on native and Web Crypto AES-256-GCM on WASM).

Weaknesses

  • Not compatible with `flutter build web --wasm` (dart2wasm) due to upstream Flutter Rust Bridge limitations.
  • Post-quantum ciphersuites are currently experimental with provisional code points.
  • Pre-1.0 underlying cryptographic implementations such as libcrux require careful consultation for production use.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Native libraries are downloaded automatically during build via Dart build hooks. Requires no manual Rust installation for end users.

import 'dart:convert';
import 'dart:typed_data';
import 'package:openmls/openmls.dart';

void main() async {
  await Openmls.init();
  final encryptionKey = Uint8List(32);
  final engine = await MlsEngine.create(
    dbPath: ':memory:',
    encryptionKey: encryptionKey,
  );
  final ciphersuite = MlsCiphersuite.mls128DhkemX25519Aes128GcmSha256Ed25519;
  final keyPair = MlsSignatureKeyPair.generate(ciphersuite: ciphersuite);
  final signerBytes = serializeSigner(
    ciphersuite: ciphersuite,
    privateKey: keyPair.privateKey(),
    publicKey: keyPair.publicKey(),
  );
  final config = MlsGroupConfig.defaultConfig(ciphersuite: ciphersuite);
  final group = await engine.createGroup(
    config: config,
    signerBytes: signerBytes,
    credentialIdentity: utf8.encode('alice'),
    signerPublicKey: keyPair.publicKey(),
  );
  print('Created group: \${group.groupId}');
  await engine.close();
  Openmls.cleanup();
}

Alternatives

Packages that do the same job and could replace openmls.

  • libsignal

    Dart wrapper for libsignal providing Signal Protocol end-to-end encryption.

  • pqforge

    Pure-Dart post-quantum cryptography for ML-KEM, ML-DSA, SLH-DSA, and HPKE.

  • wasm_interop

    Dart wrapper for the WebAssembly JavaScript API.

Works with

Packages commonly used together with openmls: ones it builds on, ones built on it, and its own family.