dargon2_flutter 1.0.4
dargon2_flutter: ^1.0.4 copied to clipboard

Flutter Android iOS

A wrapper over dargon2 for Flutter application compatibility

dargon2_flutter #

License: MIT

A wrapper plugin over the dargon2 plugin to handle the platform-specific dart:ffi integrations for iOS and Android Uses the reference C implementation of Argon2, winner of the Password Hash Competition

Usage #

High-level hashing and verification (for direct hashing & verification of byte arrays, check the example on dargon2)

void _hash() {
   var password = 'password';
   //use Salt(List<int> bytes) for a salt from an Integer list
   var s = Salt.newSalt();
   //Hash with pre-set params (iterations: 32, memory: 256, parallelism: 2, 
   //length: 32, type: Argon2Type.i, version: Argon2Version.V13)
   var result = argon2.hashPasswordString(password, salt: s);
   
   //Raw hash values available as int list, base 64 string, and hex string
   var bytesRaw = result.rawBytes;
   var base64Hash = result.base64String;
   var hexHash = result.hexString;
   
   //Encoded hash values available as int list and encoded string
   var bytesEncoded = result.encodedBytes;
   var stringEncoded = result.encodedString;
   
   //Verify password (returns true/false), uses default type (Argon2Type.i)
   var verified = argon2.verifyHashString(password, stringEncoded);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Licensing #

1
likes
100
pub points
10%
popularity

Publisher

tmthecoder.dev

A wrapper over dargon2 for Flutter application compatibility

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dargon2, ffi, flutter

More

Packages that depend on dargon2_flutter