Skip to content

Entropy-based secure random password generator

License

Notifications You must be signed in to change notification settings

raget/Passwords

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build

Secure random password generator for .Net Core

Generates passwords based on given entropy.
Use entropy 128 or more for secure alphanumerics passwords.

Samples

const int entropy = 128;

// Example 1: Generate password using default random number generator
using var defaultPasswordGenerator = new DefaultPasswordGenerator();
var password = defaultPasswordGenerator.GenerateAlphanumericPassword(entropy);

Console.WriteLine(password);

// Example 2: Generate password from custom character pool
var pool = PasswordGenerator.Alphanumerics.Union(new int[] {'*', '.', '/', '?', '-', '.', '_'});
password = PasswordGenerator.Default.GeneratePassword(entropy, pool);

Console.WriteLine(password);

// Example 3: Generate password using custom random number generator
using (var randomNumberGenerator = new RNGCryptoServiceProvider())
{
    var passwordGenerator = new PasswordGenerator(randomNumberGenerator);
    password = passwordGenerator.GenerateAlphanumericPassword(entropy);
}

Console.WriteLine(password);

About

Entropy-based secure random password generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages