RNGCryptoServiceProvider missing from .NET Core. Use RandomNumberGenerator.Create() to get an instance of CSPRNG that will run on the correct platform. Its API is the same as RNGCryptoServiceProvider , except that GetNonZeroBytes missing (which I would say was not even there).
On Windows, this will work before BCryptGenRandom on CNG, and on Linux it will use OpenSSL.
source share