Skip to content

Commit 7c3122a

Browse files
authored
Merge pull request github#14828 from tamasvajk/docs/insecure-randomness
C#: Update insecure randomness query description to match implementation
2 parents 8a8031d + b2c8049 commit 7c3122a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

csharp/ql/src/Security Features/InsecureRandomness.qhelp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ number generator. <code>Random</code> is not cryptographically secure, and shoul
2929
security contexts. For contexts which are not security sensitive, <code>Random</code> may be
3030
preferable as it has a more convenient interface, and is likely to be faster.
3131
</p>
32-
<p>
33-
For the specific use-case of generating passwords, consider
34-
<code>System.Web.Security.Membership.GeneratePassword</code>, which provides a cryptographically
35-
secure method of generating random passwords.
36-
</p>
3732

3833
</recommendation>
3934

@@ -54,10 +49,7 @@ purpose. In this case, it is much harder to predict the generated integers.
5449
</p>
5550
<p>
5651
In the final example, the password is generated using the <code>Membership.GeneratePassword</code>
57-
library method, which uses a cryptographically secure random number generator to generate a random
58-
series of characters. This method should be preferred when generating passwords, if possible, as it
59-
avoids potential pitfalls when converting the output of a random number generator (usually an int or
60-
a byte) to a series of permitted characters.
52+
library method, which generates a password with a bias, therefore should be avoided.
6153
</p>
6254
<sample src="InsecureRandomness.cs" />
6355

0 commit comments

Comments
 (0)