Skip to content

Commit

Permalink
Add readme, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Holmer committed Dec 21, 2016
1 parent 5fb692d commit 6b89873
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: rust

matrix:
include:
- os: linux
rust: stable
cache: cargo
- os: linux
rust: beta
cache: cargo
- os: linux
rust: nightly
cache: cargo
allow_failures:
- rust: beta
- rust: nightly

notifications:
email:
on_success: never
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2016 Joshua Holmer

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# zxcvbn

[![Build Status](https://travis-ci.org/shssoichiro/zxcvbn-rs.svg?branch=master)](https://travis-ci.org/shssoichiro/zxcvbn-rs)
[![Version](https://img.shields.io/crates/v/zxcvbn.svg)](https://crates.io/crates/zxcvbn)
[![License](https://img.shields.io/crates/l/zxcvbn-rs.svg)](https://github.com/shssoichiro/zxcvbn-rs/blob/master/LICENSE)

## Overview

This library is a Rust port of Dropbox's `zxcvbn` Javascript library. The following description is borrowed from their Readme:

`zxcvbn` is a password strength estimator inspired by password crackers. Through pattern matching and conservative estimation, it recognizes and weighs 30k common passwords, common names and surnames according to US census data, popular English words from Wikipedia and US television and movies, and other common patterns like dates, repeats (`aaa`), sequences (`abcd`), keyboard patterns (`qwertyuiop`), and l33t speak.

Consider using zxcvbn as an algorithmic alternative to password composition policy — it is more secure, flexible, and usable when sites require a minimal complexity score in place of annoying rules like "passwords must contain three of {lower, upper, numbers, symbols}".

* __More secure__: policies often fail both ways, allowing weak passwords (`P@ssword1`) and disallowing strong passwords.
* __More flexible__: zxcvbn allows many password styles to flourish so long as it detects sufficient complexity — passphrases are rated highly given enough uncommon words, keyboard patterns are ranked based on length and number of turns, and capitalization adds more complexity when it's unpredictaBle.
* __More usable__: zxcvbn is designed to power simple, rule-free interfaces that give instant feedback. In addition to strength estimation, zxcvbn includes minimal, targeted verbal feedback that can help guide users towards less guessable passwords.

## Installing

`zxcvbn` can be added to your project's `Cargo.toml` under the `[dependencies]` section, as such:

```toml
[dependencies]
zxcvbn = "0.1.0"
```

If your project will only be built against the nightly Rust compiler, you can add the `unstable` feature flag to enable
some nightly-exclusive features such as SIMD which may improve performance.

```toml
[dependencies]
zxcvbn = { version = "0.1.0", features = ["unstable"] }
```

zxcvbn follows Semantic Versioning.

## Usage

Full API documentation can be found [here](https://docs.rs/crate/zxcvbn).

`zxcvbn` exposes one function called `zxcvbn` which can be called to calculate a score (0-4) for a password as well as other relevant information.
`zxcvbn` may also take an array of user inputs (e.g. username, email address, city, state) to provide warnings for passwords containing such information.

Usage example:

```rust
extern crate zxcvbn;

use zxcvbn::zxcvbn;

fn main() {
let estimate = zxcvbn("correcthorsebatterystaple", None).unwrap();
println!("{}", estimate.score); // 3
}
```

Other fields available on the returned `Entropy` struct may be viewed in the [full documentation](https://docs.rs/crate/zxcvbn).

## Contributing

Any contributions are welcome and will be accepted via pull request on GitHub. Bug reports can be
filed via GitHub issues. Please include as many details as possible. If you have the capability
to submit a fix with the bug report, it is preferred that you do so via pull request,
however you do not need to be a Rust developer to contribute.
Other contributions (such as improving documentation or translations) are also welcome via GitHub.

## License

zxcvbn is open-source software, distributed under the MIT license.

0 comments on commit 6b89873

Please sign in to comment.