Skip to content

Commit dca9cb5

Browse files
committed
Avoid to give advice on password generation
1 parent e0395fd commit dca9cb5

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/distributions/other.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,19 @@ use serde::{Serialize, Deserialize};
4040
/// # Passwords
4141
///
4242
/// Users sometimes ask whether it is safe to use a string of random characters
43-
/// as a password. `Alphanumeric` generates from an alphabet of 62 symbols, thus
44-
/// each character can provide `log2(62) = 5.95...` bits of entropy. We suggest
45-
/// consulting external sources for more. One may start with the
46-
/// [Wikipedia article on Password Strength](https://en.wikipedia.org/wiki/Password_strength).
43+
/// as a password. In principle, all RNGs in Rand implementing `CryptoRng` are
44+
/// suitable as a source of randomness for generating passwords (if they are
45+
/// properly seeded), but it is more conservative to only use randomness
46+
/// directly from the operating system via the `getrandom` crate, or the
47+
/// corresponding bindings of a crypto library.
4748
///
48-
/// We caution that strings produced by sampling `Alphanumeric` tend not
49-
/// to be particularly memorable when used as passwords by humans.
50-
/// Drawing words from a specially-curated word-list such as
51-
/// [Diceware](https://en.wikipedia.org/wiki/Diceware) may be a better option
52-
/// for memorable passwords.
53-
/// Each random word contributes `log2(wordlist_length)` bits of entropy.
49+
/// When generating passwords or keys, it is important to consider the threat
50+
/// model and in some cases the memorability of the password. This is out of
51+
/// scope of the Rand project, and therefore we defer to the following
52+
/// references:
53+
///
54+
/// - [Wikipedia article on Password Strength](https://en.wikipedia.org/wiki/Password_strength)
55+
/// - [Diceware for generating memorable passwords](https://en.wikipedia.org/wiki/Diceware)
5456
#[derive(Debug)]
5557
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
5658
pub struct Alphanumeric;

0 commit comments

Comments
 (0)