Skip to content
pubscout

libsignal_protocol_dart

0.8.2, released 5 months ago by mixin.dev

Pure Dart implementation of the Signal Protocol for end‑to‑end encrypted messaging.

WASM-readyCopyleft license
$ flutter pub add libsignal_protocol_dart
Source repository

What it does

Provides Signal Protocol primitives such as identity key generation, pre‑key bundles, session building, and group messaging. Includes in‑memory stores and helpers to encrypt/decrypt messages across platforms.

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

Use it when

  • You need end‑to‑end encryption in a pure‑Dart/Flutter app without native dependencies
  • Cross‑platform support (mobile, web, desktop) is required
  • You want to implement custom key stores or session management

Skip it when

  • A GPL‑3.0 license is unacceptable for your project
  • You need a highly‑optimized native cryptography library
  • You already use a different secure messaging protocol

Strengths

  • Pure Dart, works on all Flutter platforms
  • No native code or platform channels required
  • Supports both one‑to‑one and group sessions

Weaknesses

  • GPL‑3.0 license may limit commercial use
  • Documentation is minimal
  • No code‑generation or high‑level abstractions

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
11
Future<void> install() async {
  final identityKeyPair = generateIdentityKeyPair();
  final registrationId = generateRegistrationId(false);
  final preKeys = generatePreKeys(0, 110);
  final signedPreKey = generateSignedPreKey(identityKeyPair, 0);
  final sessionStore = InMemorySessionStore();
  final preKeyStore = InMemoryPreKeyStore();
  final signedPreKeyStore = InMemorySignedPreKeyStore();
  final identityStore = InMemoryIdentityKeyStore(identityKeyPair, registrationId);
  for (var p in preKeys) {
    await preKeyStore.storePreKey(p.id, p);
  }
  await signedPreKeyStore.storeSignedPreKey(signedPreKey.id, signedPreKey);
}

Alternatives

Packages that do the same job and could replace libsignal_protocol_dart.

  • webcrypto

    Cross-platform implementation of Web Cryptography APIs for Dart.

  • blockchain_utils

    Comprehensive pure-Dart cryptography and blockchain toolkit with optional Rust backend.

  • pqforge

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

  • libsignal

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

Works with

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