パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.8.2

libsignal_protocol_dart

DartネイティブおよびFlutter用のSignalプロトコルライブラリ、Signalプロトコルの純粋なDart実装

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.8万
いいね数
67
Pub ポイント
150

パッケージをインストール

flutter pub add libsignal_protocol_dart

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Signalプロトコルの純粋なDart実装であり、FlutterおよびDartアプリケーションで安全なエンドツーエンド暗号化通信を可能にします。クロスプラットフォーム対応を目的としており、Android、iOS、Web、macOS、Windows、Linuxをサポートしています。プライベートメッセージングに不可欠な強力な暗号化プリミティブ(鍵交換、メッセージ暗号化、セッション管理など)を提供します。Mixin Networkによって開発され、既存のSignalプロトコルエコシステムとの互換性を保ちつつ、すべてのプラットフォームでパフォーマンスとセキュリティ基準を維持しています。

用途

  • セキュアなメッセージングアプリ
  • エンドツーエンド暗号化チャット
  • クロスプラットフォーム暗号化通信
  • プライベートデータ転送
  • リアルタイム暗号化された音声/動画通話
  • セキュアなセッションによる認証

主な機能

  • 純粋なDart実装
  • クロスプラットフォーム対応
  • エンドツーエンド暗号化
  • セッション管理
  • 鍵交換プロトコル
  • Signalプロトコル仕様に準拠

適している対象

  • セキュアなメッセージングを構築する開発者
  • 強力な暗号化を必要とするアプリ
  • マルチプラットフォームアプリケーション
  • プライバシー重視のサービス
  • 安全なリアルタイム通信を実装するチーム

注意事項

  • 暗号化の概念を理解する必要があります
  • 低価格端末ではパフォーマンスのオーバーヘッドが発生する可能性があります
  • セキュリティを確保するためには正しい実装に依存します
  • 暗号化されていない使用状況には適していません
  • シグナルプロトコル固有の機能に限定

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

libsignal_protocol_dart

pub package Dart CI

libsignal_protocol_dart is a pure Dart/Flutter implementation of the Signal Protocol.

Documentation

For more information on how the Signal Protocol works:

Usage

Install time

At install time, a signal client needs to generate its identity keys, registration id, and prekeys.

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);
}

Building a session

A signal client needs to implement four interfaces: IdentityKeyStore, PreKeyStore, SignedPreKeyStore, and SessionStore. These will manage loading and storing of identity, prekeys, signed prekeys, and session state.

Once those are implemented, you can build a session in this way:

  final remoteAddress = SignalProtocolAddress("remote", 1);
  final sessionBuilder = SessionBuilder(sessionStore, preKeyStore,
      signedPreKeyStore, identityStore, remoteAddress);

  sessionBuilder.processPreKeyBundle(retrievedPreKey);

  final sessionCipher = SessionCipher(sessionStore, preKeyStore,
      signedPreKeyStore, identityStore, remoteAddress);
  final ciphertext = sessionCipher.encrypt(utf8.encode("Hello Mixin"));

  deliver(ciphertext);

Building a group session

If you wanna send message to a group, send a SenderKeyDistributionMessage to all members of the group.

  const alice = SignalProtocolAddress('+00000000001', 1);
  const groupSender = SenderKeyName('Private group', alice);
  final aliceStore = InMemorySenderKeyStore();
  final bobStore = InMemorySenderKeyStore();

  final aliceSessionBuilder = GroupSessionBuilder(aliceStore);
  final bobSessionBuilder = GroupSessionBuilder(bobStore);

  final aliceGroupCipher = GroupCipher(aliceStore, groupSender);
  final bobGroupCipher = GroupCipher(bobStore, groupSender);

  final sentAliceDistributionMessage =
      await aliceSessionBuilder.create(groupSender);
  final receivedAliceDistributionMessage =
      SenderKeyDistributionMessageWrapper.fromSerialized(
          sentAliceDistributionMessage.serialize());
  await bobSessionBuilder.process(
      groupSender, receivedAliceDistributionMessage);

  final ciphertextFromAlice = await aliceGroupCipher
      .encrypt(Uint8List.fromList(utf8.encode('Hello Mixin')));
  final plaintextFromAlice = await bobGroupCipher.decrypt(ciphertextFromAlice);
  // ignore: avoid_print
  print(utf8.decode(plaintextFromAlice));

カテゴリー

依存関係

依存関係一覧 11 件

ソースリポジトリ

このパッケージを使用しているプロジェクト