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

パッケージ詳細v1.0.0

crypto_keys_plus

暗号署名/検証および暗号化/復号化を行うためのライブラリです。

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

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

flutter pub add crypto_keys_plus

パッケージ概要

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

署名、検証、暗号化、復号などの暗号操作に特化したFlutter/Dartパッケージです。Android、iOS、Web、macOS、Windows、Linuxで機密情報を安全かつクロスプラットフォームで処理するためのソリューションを提供します。シンプルさを重視して構築されており、暗号に関する深い専門知識がなくても、堅牢なセキュリティ機能を実装できるようにしています。利用可能な場合、下位のネイティブ暗号APIを活用することで、パフォーマンスとプラットフォーム固有のセキュリティ基準への準拠を確保しています。

用途

  • セキュアなデータ送信
  • デジタル署名の検証
  • エンドツーエンド暗号化
  • 認証トークンの保護
  • 機密データの安全なローカルストレージ
  • データプライバシー規制への準拠

主な機能

  • クロスプラットフォームな暗号化サポート
  • 署名および暗号化のためのシンプルな API
  • ネイティブな暗号ライブラリとの統合
  • 複数のプラットフォームのサポート
  • セキュアなキー管理
  • オープンソースで積極的にメンテナンスされています

適している対象

  • セキュアなアプリを開発する開発者
  • データ整合性を必要とするアプリ
  • ユーザー認証を処理するアプリケーション
  • 暗号化された通信が必要なプロジェクト
  • コンプライアンスとセキュリティを最優先とするチーム

注意事項

  • 基本的な暗号化の概念を理解している必要があります
  • プラットフォーム固有の暗号実装に依存しています
  • 高性能な暗号化ワークロードには適していません
  • キー管理のベストプラクティスに従う必要があります
  • 基本的な使用法を超えるドキュメントは限られている

元の README

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

Build Status :heart: sponsor

A library for doing cryptographic signing/verifying and encrypting/decrypting.

It uses pointycastle under the hood, but exposes a more convenient api.

Usage

Signing

A simple usage example:

import 'package:crypto_keys/crypto_keys.dart';
import 'dart:typed_data';

main() {
  // Create a key pair from a JWK representation
  var keyPair = new KeyPair.fromJwk({
    "kty": "oct",
    "k": "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75"
        "aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow"
  });

  // A key pair has a private and public key, possibly one of them is null, if
  // required info was not available when construction
  // The private key can be used for signing
  var privateKey = keyPair.privateKey;

  // Create a signer for the key using the HMAC/SHA-256 algorithm
  var signer = privateKey.createSigner(algorithms.signing.hmac.sha256);

  // Sign some content, to be integrity protected
  var content = "It's me, really me";
  var signature = signer.sign("It's me, really me".codeUnits);

  print("Signing '$content'");
  print("Signature: ${signature.data}");

  // The public key can be used for verifying the signature
  var publicKey = keyPair.publicKey;

  // Create a verifier for the key using the specified algorithm
  var verifier = publicKey.createVerifier(algorithms.signing.hmac.sha256);

  var verified =
      verifier.verify(new Uint8List.fromList(content.codeUnits), signature);
  if (verified)
    print("Verification succeeded");
  else
    print("Verification failed");
}
Encryption

A simple usage example:


import 'package:crypto_keys/crypto_keys.dart';
import 'dart:typed_data';

main() {
  // Generate a new random symmetric key pair
  var keyPair = new KeyPair.generateSymmetric(128);

  // Use the public key to create an encrypter with the AES/GCM algorithm
  var encrypter =
      keyPair.publicKey.createEncrypter(algorithms.encryption.aes.gcm);

  // Encrypt the content with an additional authentication data for integrity
  // protection
  var content = "A very secret text";
  var aad = "It is me";
  var v = encrypter.encrypt(new Uint8List.fromList(content.codeUnits),
      additionalAuthenticatedData: new Uint8List.fromList(aad.codeUnits));

  print("Encrypting '$content'");
  print("Ciphertext: ${v.data}");
  print("Authentication tag: ${v.authenticationTag}");

  // Use the private key to create the decrypter
  var decrypter =
      keyPair.privateKey.createEncrypter(algorithms.encryption.aes.gcm);

  // Decrypt and verify authentication tag
  var decrypted = decrypter.decrypt(v);

  print("Decrypted text: '${new String.fromCharCodes(decrypted)}'");
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Sponsor

Creating and maintaining this package takes a lot of time. If you like the result, please consider to :heart: sponsor. With your support, I will be able to further improve and support this project.

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

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