패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.0

crypto_keys_plus

암호 서명/검증 및 암호화/복호화를 수행하기 위한 라이브러리입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
8만
좋아요
3
Pub 점수
150

패키지 설치

flutter pub add crypto_keys_plus

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

서명, 검증, 암호화 및 복호화와 같은 암호화 작업을 위한 Flutter/Dart 패키지입니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스에서 민감한 정보를 안전하고 크로스 플랫폼으로 처리할 수 있는 솔루션을 제공합니다. 단순성을 중심으로 설계되어 암호학에 깊은 전문 지식 없이도 강력한 보안 기능을 구현할 수 있도록 합니다. 사용 가능한 경우 하위 레벨의 네이티브 암호화 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 개

소스 저장소

이 패키지를 사용하는 프로젝트