Search results for query: *

  1. pampua84

    Algorithm to generate secure number of fixed lenght with RNGCryptoServiceProvider

    Hello, sorry, maybe I was not very clear in asking the question, the line rng.GetBytes (randomData); fills the 8 bytes (32bit) with random values then var randomInt = BitConverter.ToUInt32(randomData, 0); it converts those random bytes to an unsigned int, then var mod = randomInt %...
  2. pampua84

    Algorithm to generate secure number of fixed lenght with RNGCryptoServiceProvider

    Hi guys, I'm looking for an algorithm to generate a safe random number like an OTP and I found this code on the web: const int min = 100000; const int max = 999999; const int elemInRange = max - min + 1; var randomData = new byte[4]; using var rng = new RNGCryptoServiceProvider()...
Back
Top Bottom