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

Opt-in end-to-end encryption for supabase_chat using the Signal Protocol (libsignal_protocol_dart): prekey distribution over Supabase and an encrypted room decorator. The server only ever sees ciphertext.

example/README.md

supabase_chat_e2ee example #

End-to-end encrypt 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_e2ee/supabase_chat_e2ee.dart';

Future<void> main() async {
  // One-time per install (persist the store + bundle yourself afterwards).
  final identity = await E2eeIdentity.generate();

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

  // Wrap a ChatRoom from supabase_chat.
  final secure = EncryptedChatRoom(
    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 πŸ”');
}
0
likes
150
points
92
downloads

Documentation

API reference

Publisher

verified publisherandroidpoet.dev

Weekly Downloads

Opt-in end-to-end encryption for supabase_chat using the Signal Protocol (libsignal_protocol_dart): prekey distribution over Supabase and an encrypted room decorator. The server only ever sees ciphertext.

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

libsignal_protocol_dart, meta, supabase, supabase_chat, supabase_realtime_kit

More

Packages that depend on supabase_chat_e2ee