rust-niceware

Crates.iorust-niceware
lib.rsrust-niceware
version0.3.0
sourcesrc
created_at2021-10-06 13:10:35.419959
updated_at2021-10-10 14:14:28.889474
descriptionGenerate or convert random bytes into passphrases. A Rust port of niceware.
homepagehttps://github.com/healeycodes/rust-niceware
repositoryhttps://github.com/healeycodes/rust-niceware
max_upload_size
id461156
size1,147,553
Andrew Healey (healeycodes)

documentation

README

rust-niceware

Rust crates.io v0.3.0

My blog post: Porting Niceware to Rust


A Rust port of niceware. Sections of this README have been copied from the original project.

This library generates random-yet-memorable passwords. Each word provides 16 bits of entropy, so a useful password requires at least 3 words.

The transformation from bytes to passphrase is reversible.

Because the wordlist is of exactly size 2^16, rust-niceware is also useful for convert cryptographic keys and other sequences of random bytes into human-readable phrases. With rust-niceware, a 128-bit key is equivalent to an 8-word phrase.

Similar to the source, heed this warning:

WARNING: The wordlist has not been rigorously checked for offensive words. Use at your own risk.

Sample use cases

  • rust-niceware can be used to generate secure, semi-memorable, easy-to-type passphrases. A random 3-5 word phrase in rust-niceware is equivalent to a strong password for authentication to most online services. For instance, +8svofk0Y1o= and bacca cavort west volley are equally strong (64 bits of randomness).

  • rust-niceware can be used to display cryptographic key material in a way that users can easily backup or copy between devices. For instance, the 128-bit random seed used to generate a 256-bit ECC key (~equivalent to a 3072-bit RSA key) is only 8 rust-niceware words. With this 8-word phrase, you can reconstruct the entire public/private key pair.

Tests

cargo test

Credits

Rust port:

@Kixunil made some fantastic changes w/r/t idiomatic and performant Rust in #2.

Code, tests, and docs are either straight-up ported/copied from, or inspired by niceware.

Original:

Niceware was inspired by Diceware. Its wordlist is derived from the SIL English word list. This project is based on [diracdeltas] work on OpenPGP key backup for the Yahoo End-to-End project.

Commit count: 48

cargo fmt