RandomNumberGeneratorクラスの具象クラスとして、RNGCryptoServiceProviderクラスが存在します。 RNGCryptoServiceProviderクラスを以下のように直接インスタンス化して暗号乱数ジェネレータとして使用することもできます。
RNGCryptoServiceProviderクラスを暗号乱数ジェネレータとして使用する
Imports System
Imports System.Security.Cryptography
Class Sample
Shared Sub Main()
Using rng As New RNGCryptoServiceProvider()
Dim nonce(15) As Byte
rng.GetBytes(nonce)
Console.WriteLine(BitConverter.ToString(nonce))
End Using
End Sub
End Class