supabase_chat_seal 0.1.0 copy "supabase_chat_seal: ^0.1.0" to clipboard
supabase_chat_seal: ^0.1.0 copied to clipboard

Permissive (MIT) end-to-end encryption for supabase_chat: a sealed box over X25519 ECDH + AES-256-GCM with safety-number verification. No copyleft dependencies, so it is safe to use in closed-source apps.

example/README.md

supabase_chat_seal example #

Permissively-licensed (MIT) end-to-end encryption for a 1:1 room: verify the peer, then send. The server only ever sees ciphertext.

import 'package:supabase_chat/supabase_chat.dart';
import 'package:supabase_chat_seal/supabase_chat_seal.dart';

Future<void> main() async {
  // One-time per install (persist the private key + trust store yourself).
  final identity = await SealIdentity.generate();

  final manager = SealManager(
    identity: identity,
    directory: SupabasePublicKeyDirectory(supabase), // your SupabaseClient
    currentUserId: myUserId,
  );
  await manager.publishOwnKeys();

  // Wrap a ChatRoom from supabase_chat.
  final secure = SealedChatRoom(
    chatRoom,
    manager,
    recipientUserIds: [peerUserId],
  );
  await secure.join();

  secure.messages.listen((items) {
    for (final m in items) {
      print(m.plaintext ?? (m.decryptFailed ? 'πŸ”’ (cannot decrypt)' : ''));
    }
  });

  // Strict mode (default): verify the peer before the first send.
  final number = await secure.safetyNumber();      // same 60 digits on both sides
  // …after the user confirms it matches out of band:
  await secure.markVerified();

  await secure.send('hello, end-to-end πŸ”');
}

A complete, backend-free console walkthrough lives at seal_demo.dart:

dart run example/seal_demo.dart
0
likes
150
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Permissive (MIT) end-to-end encryption for supabase_chat: a sealed box over X25519 ECDH + AES-256-GCM with safety-number verification. No copyleft dependencies, so it is safe to use in closed-source apps.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

crypto, cryptography, meta, supabase, supabase_chat, supabase_realtime_kit

More

Packages that depend on supabase_chat_seal