Pure Dart Argon2 algorithm (the winner of the Password Hash Competition 2015) for all Dart platforms (JS/Web, Flutter, VM/Native).

Related tags

Desktop argon2
Overview

argon2

pub package Null Safety

CI GitHub Tag New Commits Last Commits Pull Requests Code size License

Pure Dart Argon2 algorithm (the winner of the Password Hash Competition 2015) for all Dart platforms (JS/Web, Flutter, VM/Native).

Based on the results of:

Converted to Dart from:

Usage

import 'dart:typed_data';

import 'package:argon2/argon2.dart';

void main() {
  var password = 'pass123456';
  var salt = 'somesalt'.toBytesLatin1();

  var parameters = Argon2Parameters(
    Argon2Parameters.ARGON2_i,
    salt,
    version: Argon2Parameters.ARGON2_VERSION_10,
    iterations: 2,
    memoryPowerOf2: 16,
  );

  print('Parameters: $parameters');

  var argon2 = Argon2BytesGenerator();

  argon2.init(parameters);

  var passwordBytes = parameters.converter.convert(password);

  print('Generating key from password...');

  var result = Uint8List(32);
  argon2.generateBytes(passwordBytes, result, 0, result.length);

  var resultHex = result.toHexString();

  print('Result: $resultHex');
}

Output:

Parameters: Argon2Parameters{ type: 1, iterations: 2, memory: 65536, lanes: 1, version: 16, converter: UTF8 }
Generating key from password...
Result: 297f7d074e07aaa46316ea006c1440dfe5707746426ec1df6c1d303ab5fd5533

Source

The official source code is hosted @ GitHub:

Features and bugs

Please file feature requests and bugs at the issue tracker.

Contribution

Any help from the open-source community is always welcome and needed:

  • Found an issue?
    • Please fill a bug report with details.
  • Wish a feature?
    • Open a feature request with use cases.
  • Are you using and liking the project?
    • Promote the project: create an article, do a post or make a donation.
  • Are you a developer?
    • Fix a bug and send a pull request.
    • Implement a new feature.
    • Improve the Unit Tests.
  • Have you already helped in any way?
    • Many thanks from me, the contributors and everybody that uses this project!

Author

Graciliano M. Passos: gmpassos@GitHub.

License

Apache License - Version 2.0

Please, provide a reference to this project and the author for any derivative work.

You might also like...

Experimental web framework for Dart. Supports SPAs and SSR.

jaspr Experimental web framework for Dart. Supports SPAs and SSR. Main Features: Familiar component model similar to Flutter widgets Easy Server Side

Jan 4, 2023

Fluttern is a web app made with Flutter to list Flutter internships/jobs for the community.

Fluttern Fluttern is a web app made with Flutter to list Flutter internships/jobs for the community. It uses Google Sheet as a backend, simplifying th

Jan 5, 2022

A platform adaptive Flutter app for desktop, mobile and web.

A platform adaptive Flutter app for desktop, mobile and web.

Flutter Folio A demo app showcasing how Flutter can deliver a great multi-platform experience, targeting iOS, Android, MacOS, Windows, Linux, and web.

Jan 2, 2023

A Portfolio Website - Flutter Web

 A Portfolio Website - Flutter Web

A Portfolio Website - Flutter Web Watch it on YouTube This UI is not Responsive A nice clean Portfolio Website for Designer or developers. Which inclu

Dec 31, 2022

A Flutter Web Plugin to display Text Widget as Html for SEO purpose

A Flutter Web Plugin to display Text Widget as Html for SEO purpose

SEO Renderer A flutter plugin (under development) to render text widgets as html elements for SEO purpose. Created specifically for issue https://gith

Nov 21, 2022

An eventual FIBS client written in Flutter and hosted on the web

An eventual FIBS client written in Flutter and hosted on the web

fibscli An eventual FIBS client written in Flutter and hosted on the web. status Currently, the app works as a stand-alone backgammon game w/o connect

Oct 26, 2022

A project that makes use of a Typescript back end and a Flutter web front end to consume the Jira API in order to visualize and interact with issues.

A project that makes use of a Typescript back end and a Flutter web front end to consume the Jira API in order to visualize and interact with issues.

Mar 20, 2022

A cross-platform app ecosystem, bringing iMessage to Android, PC (Windows, Linux, & even macOS), and Web!

BlueBubbles Android App BlueBubbles is an open-source and cross-platform ecosystem of apps aimed to bring iMessage to Android, Windows, Linux, and mor

Jan 8, 2023

A web dashboard that allows you to monitor your Chia farm and sends notifications when blocks are found and new plots are completed through a discord bot. It can link multiple farmers/harvesters to your account.

A web dashboard that allows you to monitor your Chia farm and sends notifications when blocks are found and new plots are completed through a discord bot. It can link multiple farmers/harvesters to your account.

farmr A web dashboard that allows you to monitor your Chia farm and sends notifications when blocks are found and new plots are completed through a di

Nov 10, 2022
Comments
  • Does not work on JS/Web platform?

    Does not work on JS/Web platform?

    When I understand the README.md correctly, this package be working when compiled to javascript and used on the web?

    for all Dart platforms (JS/Web, Flutter, VM/Native).

    but when trying to run the tests on chrome:

    ➜  argon2 git:(master) pub run test -p chrome 
    Precompiling executable... (10.4s)
    Precompiled test:test.
    00:02 +0: compiling test/argon2_test.dart                                                                                                                                              
    lib/src/argon2_base.dart:61:27:
    Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
      static const int M32L = 0xFFFFFFFFFFFFFFFF;
                              ^^^^^^^^^^^^^^^^^^
    lib/src/argon2_extension.dart:73:15:
    Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
                ((0xFFFFFFFFFFFFFFFF) ^ ((1 << (64 - count)) - 1));
                  ^^^^^^^^^^^^^^^^^^
    Error: Compilation failed.
    
    opened by hpoul 2
Releases(1.0.1)
Owner
Graciliano Monteiro Passos
Graciliano Monteiro Passos
File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.

A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support.

Miguel Ruivo 987 Jan 6, 2023
A push notification application for multiple platforms

notifi.it App | Website | Backend Run locally create an .env with the example content SERVER_KEY=Hu2J7b7xA8MndeNS KEY_STORE=notifi-local DEV=true TLS=

Maximilian Mitchell 34 Nov 3, 2022
A pure Dart implementation of Firebase with initial support aimed at FlutterFire for Linux & Windows.

FlutterFire Desktop A work in progress pure Dart implementation of Firebase with initial support aimed at FlutterFire for Linux & Windows. A FlutterFi

Invertase 293 Jan 4, 2023
Dart web - Experimental web framework for Dart. Supports SPA and SSR

dart_web Experimental web framework for Dart. Supports SPA and SSR. Relies on pa

Kilian Schulte 307 Dec 23, 2022
Binder is a web framework that can be used to create web apps and APIs .

Binder Framework Binder is a web framework that can be used to create web apps and APIs . It's like React + Express or any combination of front-end fr

Kab Agouda 8 Sep 13, 2022
Native Dart client library for DBus

A native Dart client implementation of D-Bus. Accessing a remote object using dart-dbus The easiest way to get started is to use dart-dbus to generate

Canonical 81 Oct 28, 2022
Native context menu for Flutter apps

native_context_menu Native context menu for flutter apps Installation flutter pub add native_context_menu Usage import 'package:native_context_menu/na

Andrei Lesnitsky 151 Dec 22, 2022
A universal clipboard for all your devices.

?? ClipIo A Universal clipboard for all your devices! It's often difficult to move some data from one device to another especially when we have to mov

Krishnendu Bera 14 Sep 30, 2021
Serverpod is a next-generation app and web server, explicitly built for the Flutter and Dart ecosystem.

Serverpod Serverpod is a next-generation app and web server, explicitly built for the Flutter and Dart ecosystem. It allows you to write your server-s

Serverpod 1k Jan 8, 2023
Dawn - a Dart web package for developing UIs in a pattern similar to Flutter.

dawn Description Dawn is a Dart web package for developing UIs in a pattern similar to Flutter. Links GitHub Repository Pub Page Documentation An Exam

Hamed Aarab 45 Jan 6, 2023