An open API service indexing awesome lists of open source software.

https://github.com/vanhakobyan/rngcryptoservicepassgen

:barber:RNGCryptoService:barber: password generator:barber:
https://github.com/vanhakobyan/rngcryptoservicepassgen

cryptography password password-generator rng service

Last synced: 4 months ago
JSON representation

:barber:RNGCryptoService:barber: password generator:barber:

Awesome Lists containing this project

README

          

# RNGCryptoService password generator



Example. The most useful method on RNGCryptoServiceProvider is the GetBytes method. And because this type implements Dispose, you can enclose it in a using-statement. We fill a four-byte array with GetBytes ten times.

```C#

using System;
using System.Security.Cryptography;

class Program
{
static void Main()
{
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
{
// Buffer storage.
byte[] data = new byte[4];

// Ten iterations.
for (int i = 0; i < 10; i++)
{
// Fill buffer.
rng.GetBytes(data);

// Convert to int 32.
int value = BitConverter.ToInt32(data, 0);
Console.WriteLine(value);
}
}
}
}

```

### The library consists of

```c#

public enum optionPass
{
pasSize,
pasUpperOnly,
pasSmallOnly,
pasDigitOnly,
pasDigitUpperSmall

}
...
...
...
public Password(optionPass passOpt, int length)
{
getPassword = NewPassword(passOpt, length).ToString();
}

```