@@ -40,17 +40,19 @@ use serde::{Serialize, Deserialize};
40
40
/// # Passwords
41
41
///
42
42
/// 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.
47
48
///
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)
54
56
#[ derive( Debug ) ]
55
57
#[ cfg_attr( feature = "serde1" , derive( Serialize , Deserialize ) ) ]
56
58
pub struct Alphanumeric ;
0 commit comments