Giter Club home page Giter Club logo

zxcvbn-dart's Introduction

Zxcvbn-Dart

Build Status

zxcvbn is a password strength estimator inspired by password crackers, developed by DropBox. This project is a Dart port of the original CoffeeScript, for use in Flutter and other Dart projects.

Usage

Zxcvbn accepts a password input and returns a score from 0-4, giving an indication of the password strength.

import 'package:zxcvbn/zxcvbn.dart';

void main() {
  final zxcvbn = Zxcvbn();

  final result = zxcvbn.evaluate('P@ssw0rd');

  print('Password: ${result.password}');
  print('Score: ${result.score}');
  print(result.feedback.warning);
  for (final suggestion in result.feedback.suggestions) {
    print(suggestion);
  }
}

The Result object includes lots more information about the password strength. This project has the same feature set as the Official Zxcvbn, so check out their documentation.

Development

This project was created as a fork of DropBox's CoffeeScript Zxcvbn library for use in Dart. Note there is already an existing Dart implementation, Xcvbnm. However, we found that Xcvbnm returned vastly different results compared to Zxcvbn official. Xcvbnm's readme also makes it clear the library is incomplete:

Please note, that library did not port all functionality but is already used in production.

This project was started with the goals:

  • Give exactly the same results for the same inputs as the CoffeeScript
  • Port all tests from CoffeeScript
  • Be as close to the original CoffeeScript as possible in order to aid implementing and debugging dart, as well as making it easier to bring upstream changes
  • Hide the coffee-like implementation from users of this library, so from the outside it feels like Dart

As this is a close port of CoffeeScript, rather than a clean room implementation, the Dart code inside src is somewhat ugly and non-standard Dart in a lot of ways. However, keeping it close to CoffeeScript is seen as more important.

Contributing

Bugs

This library should give the exact same output for a password input as the official library. The official library can be tested online. If this library gives a different result (score, or guesses_log10), please file a bug report, detailing the password input, user dictionaries (if used), and the expected result.

API

While the internals of this library need to stay as close to the CoffeeScript as possible, we want this to be a nice library to use. Contributions that improve the API for users are welcome. The goal is to hide the internals as much as possible, giving a nice API from the outside.

Upstream Changes

Zxcvbn hasn't been updated for several years, but that doesn't mean it won't ever see updates. We welcome contributions that bring over upstream changes - again, keeping the internal Dart code as close to the CoffeeScript as possible.

Acknowledgements

  • This project is a manual port of the official Zxcvbn CoffeeScript source code, and would not be possible without DropBox creating and open sourcing the library

  • This project made use of Xcvbnm's source code to verify Dart ports, and a bit of Copy-Paste here and there to speed up porting. We thank the original authors of Xcvbnm.

zxcvbn-dart's People

Contributors

aaroncampbell avatar alexbecker avatar aybabtme avatar codetheweb avatar croby avatar demers-eric avatar dwolfhub avatar evilaliv3 avatar hpoul avatar lmordell avatar lowe avatar mans0954 avatar michaelmarner avatar mjethani avatar nathanreb avatar nmalkin avatar raphaelmp avatar rasky avatar reedloden avatar rianhunter avatar rohitjha avatar sandro-pasquali avatar shssoichiro avatar studds avatar sudo-plz avatar tekul avatar tomsommer avatar tostino avatar vvatanabe avatar zlatanvasovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.