Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

307 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

C# Password Generator

CI Build CodeQL NuGet Version License

This library provides a random password generator in C#. The type of algorithm is commonly used when generating website passwords.

Randomness is provided by the RandomNumberGenerator class, which is a cryptographic random number generator.

This was inspired by a tweet asking how to generate safe passwords in .NET and a Google search which ended up finding Seth Vargo's Golang Password Generator.

Usage

using idunno.Password;

// Generate a password that is 64 characters long with 10 digits, 10 symbols,
// allowing upper and lower case letters, disallowing repeat characters.
var generatedPassword = PasswordGenerator.Generate(64, 10, 10, false, false);

// Generate a password that is 32 characters long with 5 digits, 5 symbols, and a custom set of allowed symbols.
var generatedPassword = PasswordGenerator.Generate(32, 5, 5, symbols: "!@#$%^&*()");

nuget packages

A nuget package is available at https://www.nuget.org/packages/idunno.Password.Generator.

License

This code is licensed under the Apache license.

About

A C# library for generating high entropy passwords similar to 1Password

Resources

Code of conduct

Contributing

Security policy

Stars

57 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages