Is there any fast implementation of cryptographically secure pseudorandom number generator (CSPRNG) for C# 3.0 (.NET Framework 3.5), for authentication tokens?
using System.Security.Cryptography; ... using(RandomNumberGenerator rng = new RNGCryptoServiceProvider()) { byte[] tokenData = new byte[32]; rng.GetBytes(tokenData); string token = Convert.ToBase64String(tokenData); }
2.1m questions
2.1m answers
60 comments
57.0k users