PasswordGenerator 1.1.2

A library which generates random passwords with different settings to meet the OWASP requirements

There is a newer version of this package available.
See the version list below for details.
Install-Package PasswordGenerator -Version 1.1.2
dotnet add package PasswordGenerator --version 1.1.2
<PackageReference Include="PasswordGenerator" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PasswordGenerator --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PasswordGenerator, 1.1.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PasswordGenerator as a Cake Addin
#addin nuget:?package=PasswordGenerator&version=1.1.2

// Install PasswordGenerator as a Cake Tool
#tool nuget:?package=PasswordGenerator&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

A library which generates random passwords with different settings to meet the OWASP requirements

NuGet

Install via NuGet: Install-Package PasswordGenerator

Nuget Downloads

Or click here to go to the package landing page

Basic usage

See examples below or try them out now in your browser using Dotnetfiddle

// By default, all characters available for use and a length of 16
// Will return a random password with the default settings 
PasswordGenerator pwdGen = new PasswordGenerator();
string password = pwdGen.Next();
// Same as above but you can set the length. Must be between 8 and 128
// Will return a password which is 32 characters long
PasswordGenerator pwdGen = new PasswordGenerator(32);
string password = pwdGen.Next();
// Same as above but you can set the length. Must be between 8 and 128
// Will return a password which only contains lowercase and uppercase characters and is 21 characters long.
PasswordGenerator pwdGen = new PasswordGenerator(includeLowercase: true, includeUppercase: true, includeNumeric: false, includeSpecial: false, passwordLength: 21);
string password = pwdGen.Next();

Fluent usage

// You can build up your reqirements by adding things to the end, like .AddNumeric()
// This will return a password which is just numbers and has a default length of 16
PasswordGenerator pwdGen = new PasswordGenerator().IncludeNumeric();
string password = pwdGen.Next();
// As above, here is how to get lower, upper and special characters using this approach
PasswordGenerator pwdGen = new PasswordGenerator().IncludeLowercase().IncludeUppercase().IncludeSpecial();
string password = pwdGen.Next();
// This is the same as the above, but with a length of 128
PasswordGenerator pwdGen = new PasswordGenerator(128).IncludeLowercase().IncludeUppercase().IncludeSpecial();
string password = pwdGen.Next();
// This is the same as the above, but with passes the length in using the method LengthRequired()
PasswordGenerator pwdGen = new PasswordGenerator().IncludeLowercase().IncludeUppercase().IncludeSpecial().LengthRequired(128);
string password = pwdGen.Next();

A library which generates random passwords with different settings to meet the OWASP requirements

NuGet

Install via NuGet: Install-Package PasswordGenerator

Nuget Downloads

Or click here to go to the package landing page

Basic usage

See examples below or try them out now in your browser using Dotnetfiddle

// By default, all characters available for use and a length of 16
// Will return a random password with the default settings 
PasswordGenerator pwdGen = new PasswordGenerator();
string password = pwdGen.Next();
// Same as above but you can set the length. Must be between 8 and 128
// Will return a password which is 32 characters long
PasswordGenerator pwdGen = new PasswordGenerator(32);
string password = pwdGen.Next();
// Same as above but you can set the length. Must be between 8 and 128
// Will return a password which only contains lowercase and uppercase characters and is 21 characters long.
PasswordGenerator pwdGen = new PasswordGenerator(includeLowercase: true, includeUppercase: true, includeNumeric: false, includeSpecial: false, passwordLength: 21);
string password = pwdGen.Next();

Fluent usage

// You can build up your reqirements by adding things to the end, like .AddNumeric()
// This will return a password which is just numbers and has a default length of 16
PasswordGenerator pwdGen = new PasswordGenerator().IncludeNumeric();
string password = pwdGen.Next();
// As above, here is how to get lower, upper and special characters using this approach
PasswordGenerator pwdGen = new PasswordGenerator().IncludeLowercase().IncludeUppercase().IncludeSpecial();
string password = pwdGen.Next();
// This is the same as the above, but with a length of 128
PasswordGenerator pwdGen = new PasswordGenerator(128).IncludeLowercase().IncludeUppercase().IncludeSpecial();
string password = pwdGen.Next();
// This is the same as the above, but with passes the length in using the method LengthRequired()
PasswordGenerator pwdGen = new PasswordGenerator().IncludeLowercase().IncludeUppercase().IncludeSpecial().LengthRequired(128);
string password = pwdGen.Next();

Release Notes

Shuffled the characterset before generating a password to counteract timestamp seed problem with the Random. Generates different password every time now.

Dependencies

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on PasswordGenerator:

Package Downloads
CocoriCore.Security
Package Description
Olmi.Core.Utils
The utilities of OLMI framework.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on PasswordGenerator:

Repository Stars
Crypto-Notepad/Crypto-Notepad
🔑 Simple notepad for Windows with encryption features

Version History

Version Downloads Last updated
2.0.5 503,848 12/30/2019
2.0.4 6,679 12/16/2019
2.0.3 2,083 12/11/2019
2.0.2 617 12/9/2019
2.0.1 65,538 9/20/2019
2.0.0 9,277 9/4/2019
1.1.3 50,764 6/9/2019
1.1.2 51,234 11/16/2016
1.1.1 901 11/13/2016
1.1.0 797 11/13/2016
1.0.0 1,149 11/12/2016
Show less