crypto_keys
0.3.1, released 7 months ago by appsup.be
Library for signing, verifying, encrypting and decrypting using pointycastle.
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.
60Compare - aes_crypt_null_safe
Dart encryption library for files, plain text and binary data using AES Crypt format.
53Compare - pinenacl
Dart implementation of TweetNaCl cryptographic library with high-level APIs
50Compare
Works with
Packages commonly used together with crypto_keys: ones it builds on, ones built on it, and its own family.
- pointycastlecrypto_keys depends on itA Dart library providing a wide range of cryptographic algorithms and primitives.
- quivercrypto_keys depends on itA set of utility libraries for Dart containing collections, async tools, and testing helpers.
- joseBuilt on crypto_keysJavascript Object Signing and Encryption library supporting JWE, JWS, JWK and JWT.
- x509Built on crypto_keysDart library for parsing and working with X.509 certificates.
- firebase_adminBuilt on crypto_keysPure Dart Firebase admin SDK for authentication and Realtime Database.
- webauthnBuilt on crypto_keysA plugin implementing the WebAuthn authenticator model for generating Public Key Credentials
- google_visionBuilt on crypto_keysIntegrates Google Vision REST API features for image analysis and OCR.