dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

Add security warning to System.Random documentation

Open sempf opened this issue 4 months ago • 1 comments

Type of issue

Missing information

Description

System.Random is not designed for cryptographic use, but that is not clearly noted on the core documentation page for the class, as referenced. I recommend adding a notification div near the top of the page noting this fact. Perhaps:

Security Notification System.Random is not for cryptographic use. For cryptographically sound random numbers for used in seeds for key creation, as an example, please see System.Security.Cryptography.Random()

This is not unlike what was on Binary Formatter for years before Barry finally took it to pasture.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.random?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/Random.xml

Document Version Independent Id

ea32dd59-b49e-473d-c696-273ca85c30ef

Platform Id

50cb73a0-8e80-a3ce-60b1-757c81dbcee3

Article author

@dotnet-bot

sempf avatar Aug 19 '25 16:08 sempf