Skip to content
pubscout

crypto_keys

0.3.1, released 7 months ago by appsup.be

Library for signing, verifying, encrypting and decrypting using pointycastle.

WASM-ready
$ flutter pub add crypto_keys
Source repository

What it does

Provides a convenient API for cryptographic operations such as HMAC, RSA, AES/GCM, and key pair generation. It wraps pointycastle to expose a simpler interface for Dart developers.

AI-written summary of version 0.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Implementing JWT or JWS signing and verification
  • Encrypting/decrypting data with AES/GCM or RSA-OAEP
  • Generating symmetric or asymmetric key pairs for local use

Skip it when

  • Need highly optimized native crypto libraries
  • Working in environments that require WebAssembly or platform-specific native bindings

Strengths

  • Simple, null‑safe API
  • Supports RSA‑PSS, RSA‑OAEP, AES/GCM, and HMAC
  • Cross‑platform (Android, iOS, Web, desktop)
  • Up-to-date pointycastle dependency

Weaknesses

  • Relies on pointycastle, which may be slower than native libs
  • No async streaming API for large data
  • Limited to algorithms exposed by pointycastle

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4
import 'package:crypto_keys/crypto_keys.dart';
import 'dart:typed_data';

void main() {
  var keyPair = KeyPair.generateSymmetric(128);
  var encrypter = keyPair.publicKey.createEncrypter(algorithms.encryption.aes.gcm);
  var content = Uint8List.fromList('Secret'.codeUnits);
  var encrypted = encrypter.encrypt(content);
  var decrypter = keyPair.privateKey.createEncrypter(algorithms.encryption.aes.gcm);
  var decrypted = decrypter.decrypt(encrypted);
  print(String.fromCharCodes(decrypted));
}

Alternatives

Packages that do the same job and could replace crypto_keys.

  • xml_crypto

    Xml digital signature library for Dart for signing and verifying XML documents.

  • aes_crypt_null_safe

    Dart encryption library for files, plain text and binary data using AES Crypt format.

  • pinenacl

    Dart implementation of TweetNaCl cryptographic library with high-level APIs

Works with

Packages commonly used together with crypto_keys: ones it builds on, ones built on it, and its own family.