3 types derived from RandomNumberGenerator
Microsoft.AspNetCore.Identity.Test (1)
PasswordHasherTest.cs (1)
192private sealed class SequentialRandomNumberGenerator : RandomNumberGenerator
System.Security.Cryptography (2)
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (1)
6internal sealed partial class RandomNumberGeneratorImplementation : RandomNumberGenerator
System\Security\Cryptography\RNGCryptoServiceProvider.cs (1)
10public sealed class RNGCryptoServiceProvider : RandomNumberGenerator
112 references to RandomNumberGenerator
Aspire.Azure.Messaging.EventHubs (1)
EventHubsComponent.cs (1)
67RandomNumberGenerator.GetHexString(12, true);
Aspire.Dashboard (1)
src\Shared\TokenGenerator.cs (1)
28return RandomNumberGenerator.GetBytes(size);
Aspire.Hosting (4)
src\Shared\TokenGenerator.cs (1)
28return RandomNumberGenerator.GetBytes(size);
Utils\PasswordGenerator.cs (3)
56RandomNumberGenerator.GetItems(choices, currentChars); 58RandomNumberGenerator.Shuffle(chars); 88RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
443var suffix = RandomNumberGenerator.GetHexString(8, lowercase: true);
Aspire.Playground.Tests (5)
Infrastructure\DistributedApplicationExtensions.cs (2)
33: Convert.ToHexString(RandomNumberGenerator.GetBytes(4)); 64renamedVolumes[name] = $"{name}-{Convert.ToHexString(RandomNumberGenerator.GetBytes(4))}";
src\Aspire.Hosting\Utils\PasswordGenerator.cs (3)
56RandomNumberGenerator.GetItems(choices, currentChars); 58RandomNumberGenerator.Shuffle(chars); 88RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
AzureFunctionsEndToEnd.ApiService (1)
Program.cs (1)
36return RandomNumberGenerator.GetString(chars, length);
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
61var newKeyMaterial = System.Security.Cryptography.RandomNumberGenerator.GetBytes(signingKeyLength);
Extensibility.MessageEncoder.IntegrationTests (2)
TextTests.4.1.0.cs (2)
86RandomNumberGenerator rnd = RandomNumberGenerator.Create();
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (1)
283RandomNumberGenerator.Fill(serial);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
278int port = RandomNumberGenerator.GetInt32(41000, 42000);
JwtSample (1)
Startup.cs (1)
14private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(32));
Microsoft.AspNetCore.Antiforgery (1)
Internal\BinaryBlob.cs (1)
80RandomNumberGenerator.Fill(data);
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTokenGeneratorTest.cs (1)
151RandomNumberGenerator.Fill(data);
Microsoft.AspNetCore.App.CodeFixes (2)
src\Shared\HashCode.cs (2)
72using var randomNumberGenerator = RandomNumberGenerator.Create();
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationHandler.cs (1)
231RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
82RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
316RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectHandler.cs (1)
414RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Components.Endpoints (1)
DependencyInjection\ServerComponentInvocationSequence.cs (1)
16RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitIdFactory.cs (1)
35RandomNumberGenerator.Fill(buffer);
Microsoft.AspNetCore.Components.Server.Tests (1)
src\Components\Endpoints\src\DependencyInjection\ServerComponentInvocationSequence.cs (1)
16RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.DataProtection (1)
Managed\ManagedGenRandomImpl.cs (1)
25RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionManager.cs (1)
113RandomNumberGenerator.Fill(buffer);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\HashCode.cs (2)
72using var randomNumberGenerator = RandomNumberGenerator.Create();
Microsoft.AspNetCore.Identity.FunctionalTests (1)
src\Identity\Extensions.Core\src\Base32.cs (1)
29RandomNumberGenerator.Fill(bytes);
Microsoft.AspNetCore.Identity.Test (2)
Base32Test.cs (2)
36private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create();
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (1)
283RandomNumberGenerator.Fill(serial);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
278int port = RandomNumberGenerator.GetInt32(41000, 42000);
Microsoft.AspNetCore.Session (2)
DistributedSession.cs (1)
115RandomNumberGenerator.Fill(_sessionIdBytes);
SessionMiddleware.cs (1)
74RandomNumberGenerator.Fill(guidBytes);
Microsoft.AspNetCore.TestHost (1)
WebSocketClient.cs (1)
116RandomNumberGenerator.Fill(data);
Microsoft.Build.Tasks.Core (2)
ManifestUtil\mansign2.cs (2)
822using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
Microsoft.Extensions.Identity.Core (10)
PasswordHasher.cs (4)
37private readonly RandomNumberGenerator _rng; 113private static byte[] HashPasswordV2(string password, RandomNumberGenerator rng) 132private byte[] HashPasswordV3(string password, RandomNumberGenerator rng) 141private static byte[] HashPasswordV3(string password, RandomNumberGenerator rng, KeyDerivationPrf prf, int iterCount, int saltSize, int numBytesRequested)
PasswordHasherOptions.cs (3)
13private static readonly RandomNumberGenerator _defaultRng = RandomNumberGenerator.Create(); // secure PRNG 36internal RandomNumberGenerator Rng { get; set; } = _defaultRng;
UserManager.cs (3)
48private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create(); 2085RandomNumberGenerator.Fill(MemoryMarshal.AsBytes(resultBuffer));
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
901[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RandomNumberGenerator))]
netstandard (1)
netstandard.cs (1)
1905[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RandomNumberGenerator))]
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
210return RandomNumberGenerator.GetString(CharacterSet, Length);
System.Net.Security (3)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
252RandomNumberGenerator.Fill(contextId);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (2)
640RandomNumberGenerator.Fill(clientChallenge); 658RandomNumberGenerator.Fill(exportedSessionKey);
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
768RandomNumberGenerator.Fill(buffer.AsSpan(offset, MaskLength));
System.Security.Cryptography (37)
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
80RandomNumberGenerator.Fill(destination);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (2)
346RandomNumberGenerator.Fill(seed); 428RandomNumberGenerator.Fill(salt);
System\Security\Cryptography\AesImplementation.cs (2)
32IV = RandomNumberGenerator.GetBytes(BlockSize / BitsPerByte); 37Key = RandomNumberGenerator.GetBytes(KeySize / BitsPerByte);
System\Security\Cryptography\DesImplementation.cs (3)
43IV = RandomNumberGenerator.GetBytes(BlockSize / BitsPerByte); 49RandomNumberGenerator.Fill(key); 53RandomNumberGenerator.Fill(key);
System\Security\Cryptography\HMACMD5.cs (1)
32: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA1.cs (1)
32: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA256.cs (1)
31: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA3_256.cs (1)
45: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA3_384.cs (1)
45: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA3_512.cs (1)
45: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA384.cs (1)
31: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\HMACSHA512.cs (1)
31: this(RandomNumberGenerator.GetBytes(BlockSize))
System\Security\Cryptography\RandomNumberGenerator.cs (5)
16public static RandomNumberGenerator Create() => RandomNumberGeneratorImplementation.s_singleton; 20public static RandomNumberGenerator? Create(string rngName) 22return (RandomNumberGenerator?)CryptoConfig.CreateFromName(rngName); 318RandomNumberGenerator.Fill(remainingRandom); 338RandomNumberGenerator.Fill(remainingRandom);
System\Security\Cryptography\RC2Implementation.cs (2)
49IV = RandomNumberGenerator.GetBytes(BlockSize / BitsPerByte); 54Key = RandomNumberGenerator.GetBytes(KeySize / BitsPerByte);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
83RandomNumberGenerator.Fill(_salt.AsSpan(0, saltSize));
System\Security\Cryptography\RNGCryptoServiceProvider.cs (1)
12private readonly RandomNumberGenerator _impl;
System\Security\Cryptography\RSAOAEPKeyExchangeFormatter.cs (2)
10private RandomNumberGenerator? RngValue; 49public RandomNumberGenerator? Rng
System\Security\Cryptography\RSAPKCS1KeyExchangeDeformatter.cs (2)
11private RandomNumberGenerator? RngValue; 22public RandomNumberGenerator? RNG
System\Security\Cryptography\RSAPKCS1KeyExchangeFormatter.cs (2)
11private RandomNumberGenerator? RngValue; 30public RandomNumberGenerator? Rng
System\Security\Cryptography\SymmetricPadding.cs (1)
86RandomNumberGenerator.Fill(destination.Slice(count, padBytes - 1));
System\Security\Cryptography\TripleDesImplementation.cs (2)
42IV = RandomNumberGenerator.GetBytes(BlockSize / BitsPerByte); 47Key = RandomNumberGenerator.GetBytes(KeySize / BitsPerByte);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
506RandomNumberGenerator.Fill(serialNumber);
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (2)
247RandomNumberGenerator.Fill(salt); 488RandomNumberGenerator.Fill(macSalt);
System.Security.Cryptography.Algorithms (1)
System.Security.Cryptography.Algorithms.cs (1)
50[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RandomNumberGenerator))]
System.Security.Cryptography.Pkcs (3)
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
80RandomNumberGenerator.Fill(destination);
System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
208RandomNumberGenerator.Fill(salt);
System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (1)
391RandomNumberGenerator.Fill(salt);
System.Security.Cryptography.Xml (2)
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (2)
32using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Mvc.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);