ecdsa
0.2.0, released 4 months ago by c0mm4nd.com
Implements ECDSA signing and verification in pure Dart.
What it does
Provides functions to generate EC keys, sign message hashes, and verify signatures. Includes deterministic signing, low‑S signatures, and Ethereum‑specific recovery helpers.
AI-written summary of version 0.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need ECDSA signatures in a Dart/Flutter app
- Building blockchain or crypto‑related features without native code
Skip it when
- Require hardware‑backed key storage or signing
- Need higher‑level authentication flows
- Performance‑critical cryptography where native libs are preferred
Strengths
- Pure Dart implementation, no native dependencies
- Supports multiple curves via elliptic package
- Security‑focused updates (deterministic, low‑S)
Weaknesses
- Limited to ECDSA only, no broader crypto suite
- May be slower than native implementations
- No built‑in key management or storage
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:ecdsa/ecdsa.dart';
import 'package:elliptic/elliptic.dart';
void main() {
var ec = getP256();
var priv = ec.generatePrivateKey();
var pub = priv.publicKey;
var hashHex = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9';
var hash = List<int>.generate(hashHex.length ~/ 2,
(i) => int.parse(hashHex.substring(i * 2, i * 2 + 2), radix: 16));
var sig = signature(priv, hash);
var result = verify(pub, hash, sig);
assert(result);
}Alternatives
Packages that do the same job and could replace ecdsa.
- aws_signature_v4
Dart implementation of AWS Signature Version 4 for signing HTTP requests.
85Compare - crypton
A simple Dart library for asymmetric encryption and digital signatures.
50Compare - package_signature
Retrieve Android package signature (SHA1/SHA256) in a Flutter app.
66Compare - cryptography_plus
Cryptographic algorithms for encryption, signatures, key agreement, and hashing across platforms.
68Compare
Works with
Packages commonly used together with ecdsa: ones it builds on, ones built on it, and its own family.
- cryptoecdsa depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- ellipticecdsa depends on itPure Dart elliptic curve math for ECDSA, ECDH, key generation.
- ssiBuilt on ecdsaAffinidi Self-Sovereign Identity library for Dart and Flutter.
- feature_flags_togglyBuilt on ecdsaFeature flags support for Flutter applications with or without Toggly.io.