dart_wordlists 0.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

dart_wordlists

A library for passphrase word lists. Inspired by Diceware and others

Created from templates made available by Stagehand under a BSD-style license.

Usage

A simple usage example:

    import 'package:dart_wordlists/dart_wordlists.dart';
    import 'package:dart_collection_sampler/dart_collection_sampler.dart';
    
    import 'package:args/args.dart';
    
    
    main(List<String> arguments) async {
      var argParser = new ArgParser()
        ..addOption("num", abbr: "n",
            help: "items to pick from rest of command line",
            defaultsTo: "6");
    
      var results = argParser.parse(arguments);
    
      sample(int.parse(results["num"]));
    }
    
    sample(int sampleSize) async {
      var loader = new WordlistLoader();
    
      var sampler = new CollectionSampler();
    
      var wordlists = [
        Wordlist.bip39_en,
        Wordlist.bip39_zh_CW,
        Wordlist.diceware_beale_en,
        Wordlist.eff_large_en
      ];
      for (var wl in wordlists) {
        var meta = loader.findMetadata(wl);
        print(loader.findMetadata(wl));
    
        var words = await loader.findLoader(wl).load();
        print(words);
    
        print ("sample: ${sampler.pickN(words, sampleSize)}");
        print ("\n");
      }
    }

Features and bugs

Please file feature requests and bugs at the issue tracker.

Similar projects

Credits

Diceware

diceware is a concept invented by Arnold G. Reinhold, Cambridge, Massachusetts USA.

The English Diceware Wordlists used with this programme are licensed by Arnold G. Reinhold (files wordlists/wordlist_en_orig.asc, wordlists/wordlist_en.txt) under the Creative Commons CC-BY 3.0 license (see http://creativecommons.org/licenses/by/3.0/).

"Diceware" is a trademark of A G Reinhold.

EFF

The EFF wordlist (file wordlsts/wordlist_en_eff.txt) is licensed by the Electronic Frontier Foundation under the Creative Commons CC-BY 3.0 US license (see https://creativecommons.org/licenses/by/3.0/us/).

See EFF's New Wordlists for Random Passphrases

BIP39

See BIP39

Changelog

0.1.1

  • add unit test for entropy

0.1.0

  • change diceware-style parser to return Map<String,String>
  • add method to calculate entropy per word from wordlist

0.0.2

  • in CLI example, don't select unique words

0.0.1

  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_wordlists: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_wordlists/dart_wordlists.dart';
  
Version Uploaded Documentation Archive
0.1.1 Dec 10, 2017 Go to the documentation of dart_wordlists 0.1.1 Download dart_wordlists 0.1.1 archive
0.1.0 Dec 10, 2017 Go to the documentation of dart_wordlists 0.1.0 Download dart_wordlists 0.1.0 archive
0.0.2 Dec 8, 2017 Go to the documentation of dart_wordlists 0.0.2 Download dart_wordlists 0.0.2 archive
0.0.1 Dec 4, 2017 Go to the documentation of dart_wordlists 0.0.1 Download dart_wordlists 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0