PasswordGenerator 1.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package PasswordGenerator --version 1.1.2                
NuGet\Install-Package PasswordGenerator -Version 1.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<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                
#r "nuget: PasswordGenerator, 1.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. 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                

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();
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (12)

Showing the top 5 NuGet packages that depend on PasswordGenerator:

Package Downloads
FEB.ClusterAdmin.Models

Package Description

CocoriCore.Security

Package Description

DanSaul.SharedCode

Package Description

Rbit.Common

Provides RBIT libraries commonly used in new projects.

Boxfusion.SheshaFunctionalTests.Common.Domain

Package Description

GitHub repositories (3)

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

Repository Stars
Stealerium/Stealerium
Stealer + Clipper + Keylogger
shesha-io/shesha-framework
An open-source Low-Code development framework for .NET developers. Create .NET based business applications with 80% less code.
Crypto-Notepad/Crypto-Notepad
🔑 Simple notepad for Windows with encryption features
Version Downloads Last updated
2.1.0 4,833,170 1/4/2022
2.0.5 2,078,496 12/30/2019
2.0.4 15,196 12/16/2019
2.0.3 4,548 12/11/2019
2.0.2 2,215 12/9/2019
2.0.1 106,970 9/20/2019
2.0.0 16,946 9/4/2019
1.1.3 59,408 6/9/2019
1.1.2 70,189 11/16/2016
1.1.1 2,485 11/13/2016
1.1.0 2,490 11/13/2016
1.0.0 6,202 11/12/2016

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