|
4 | 4 | <qhelp> |
5 | 5 | <overview> |
6 | 6 | <p> |
7 | | - Using a cryptographically weak pseudo-random number generator to generate a security-sensitive value, |
8 | | - such as a password, makes it easier for an attacker to predict the value. |
| 7 | + If you use a cryptographically weak pseudo-random number generator to generate security-sensitive values, |
| 8 | + such as passwords, attackers can more easily predict those values. |
9 | 9 | </p> |
10 | 10 | <p> |
11 | 11 | Pseudo-random number generators generate a sequence of numbers that only approximates the properties |
12 | 12 | of random numbers. The sequence is not truly random because it is completely determined by a |
13 | | - relatively small set of initial values, the seed. If the random number generator is |
| 13 | + relatively small set of initial values (the seed). If the random number generator is |
14 | 14 | cryptographically weak, then this sequence may be easily predictable through outside observations. |
15 | 15 | </p> |
16 | 16 |
|
17 | 17 | </overview> |
18 | 18 | <recommendation> |
19 | 19 | <p> |
20 | 20 | Use a cryptographically secure pseudo-random number generator if the output is to be used in a |
21 | | - security-sensitive context. As a rule of thumb, a value should be considered "security-sensitive" |
| 21 | + security-sensitive context. As a general rule, a value should be considered "security-sensitive" |
22 | 22 | if predicting it would allow the attacker to perform an action that they would otherwise be unable |
23 | 23 | to perform. For example, if an attacker could predict the random password generated for a new user, |
24 | 24 | they would be able to log in as that new user. |
|
36 | 36 | </p> |
37 | 37 |
|
38 | 38 | <p> |
39 | | - In the first case, we generate a fresh cookie by appending a random integer to the end of a static |
| 39 | + In the first (BAD) case, we generate a fresh cookie by appending a random integer to the end of a static |
40 | 40 | string. The random number generator used (<code>Random</code>) is not cryptographically secure, |
41 | 41 | so it may be possible for an attacker to predict the generated cookie. |
42 | 42 | </p> |
|
0 commit comments