Skip to content
pubscout

crypto

3.0.8, released 4 weeks ago by dart.dev

Provides SHA, MD5, and HMAC hashing functions for Dart.

WASM-readyRock solid
$ flutter pub add crypto
Source repository

What it does

Implements common cryptographic hash algorithms (SHA‑1/224/256/384/512, MD5) and HMAC support. All code is pure Dart and works on every Flutter platform.

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

Use it when

  • You need to compute hashes or HMACs locally in a Dart/Flutter app.
  • You require a lightweight, pure‑Dart solution without native dependencies.

Skip it when

  • You need audited, security‑certified cryptography.
  • You require algorithms not provided (e.g., Argon2, RSA).

Strengths

  • Pure Dart, no native dependencies
  • Supports a wide range of hash functions and HMAC
  • Works on all Flutter platforms
  • Performance improvements in recent versions

Weaknesses

  • Not reviewed by security professionals
  • Limited to hashing/HMAC, no encryption or key management
  • May lack the latest cryptographic primitives

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:crypto/crypto.dart';
import 'dart:convert';

void main() {
  var bytes = utf8.encode('foobar');
  var digest = sha1.convert(bytes);
  print('Digest: $digest');
}

Alternatives

Packages that do the same job and could replace crypto.

Works with

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