Skip to content
pubscout

dargon2_flutter

3.3.0, released 3 years ago by tmthecoder.dev

Argon2 password hashing for Flutter mobile, desktop, and web apps.

WASM-ready
$ flutter pub add dargon2_flutter
Source repository

What it does

Provides Argon2 password hashing and verification functionality using reference C implementations on native platforms and WebAssembly on the web.

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

Use it when

  • You need secure password hashing using Argon2 in a Flutter application.
  • You require cross-platform support covering mobile, desktop, and web.

Skip it when

  • You are using a pure Objective-C iOS setup without Swift/bridging header support and cannot add one.
  • You need synchronous hashing methods (removed in version 3.0.0).

Strengths

  • Supports a wide range of platforms including mobile, desktop, and web.
  • Uses reference C implementations and hash-wasm for performance.

Weaknesses

  • Requires extra setup steps for pure Objective-C iOS projects.
  • Requires explicit initialization calls when used inside isolates or on older Flutter versions.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
6

Requires a dummy Swift file with a bridging header for pure Objective-C iOS apps, and build-essential packages on Linux.

void _hash() async {
   var password = 'password';
   var s = Salt.newSalt();
   var result = await argon2.hashPasswordString(password, salt: s);
   var verified = await argon2.verifyHashString(password, result.encodedString);
}

Alternatives

Packages that do the same job and could replace dargon2_flutter.

  • crypto

    If you only need standard Dart cryptographic hashes like SHA or MD5 instead of Argon2.