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); }
1.4m articles
1.4m replys
5 comments
57.0k users