Skip to content
pubscout

crypt

4.3.1, released 3 years ago by hoylen.com

One-way string hashing for salted passwords using the Unix crypt format.

WASM-ready
$ flutter pub add crypt
Source repository

What it does

It implements SHA-256 and SHA-512 crypt hash formats commonly used in Unix, POSIX systems, and LDAP authentication. It provides functionality to generate crypt format hashes with custom or random salts and rounds, as well as to verify entered passwords against existing hashes.

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

Use it when

  • You need to verify or generate Unix crypt format passwords for LDAP or POSIX integration.
  • You require SHA-256 or SHA-512 password hashing with salt and round configurations.

Skip it when

  • You are building a general-purpose modern application auth backend where bcrypt, Argon2, or platform-standard auth (like Firebase Auth) are preferred.
  • You need algorithms other than SHA-256 and SHA-512 crypt.

Strengths

  • Supports both SHA-256 and SHA-512 Unix crypt formats.
  • Allows configuring iteration rounds and custom salts.
  • Provides cryptographically secure random salt generation.

Weaknesses

  • Limited to only SHA-256 and SHA-512 Unix crypt formats.
  • Older insecure algorithms are not supported (by design).

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:crypt/crypt.dart';

void main() {
  final c1 = Crypt.sha256('p@ssw0rd');
  final bool isValid = c1.match('p@ssw0rd');
  print(isValid);
}

Alternatives

Packages that do the same job and could replace crypt.

  • otp

    Generate TOTP/HOTP codes per RFC6238/4226 with Base32 secrets and optional Google Auth mode.

  • validators2

    String validation and sanitization for Dart.

  • totp

    Generate and verify Time-based One-time Passwords (TOTP) following RFC 6238.

  • package_signature

    Retrieve Android package signature (SHA1/SHA256) in a Flutter app.

Works with

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