PasswordGenerator 2.1.0

.NET Standard 2.0
Install-Package PasswordGenerator -Version 2.1.0
dotnet add package PasswordGenerator --version 2.1.0
<PackageReference Include="PasswordGenerator" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PasswordGenerator --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PasswordGenerator, 2.1.0"
#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=2.1.0

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

Password Generator

Password Logo

A .NET Standard 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

It is Compatible with .NET Core, .NET Framework and more. See the below chart:

Compatibility Chart

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 
var pwd = new Password();
var password = pwd.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
var pwd = new Password(32);
var password = pwd.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.
var pwd = new Password(includeLowercase: true, includeUppercase: true, includeNumeric: false, includeSpecial: false, passwordLength: 21);
var password = pwd.Next();

Fluent usage

// You can build up your reqirements by adding things to the end, like .IncludeNumeric()
// This will return a password which is just numbers and has a default length of 16
var pwd = new Password().IncludeNumeric();
var password = pwd.Next();
// As above, here is how to get lower, upper and special characters using this approach
var pwd = new Password().IncludeLowercase().IncludeUppercase().IncludeSpecial();
var password = pwd.Next();
// This is the same as the above, but with a length of 128
var pwd = new Password(128).IncludeLowercase().IncludeUppercase().IncludeSpecial();
var password = pwd.Next();
// This is the same as the above, but with passes the length in using the method LengthRequired()
var pwd = new Password().IncludeLowercase().IncludeUppercase().IncludeSpecial().LengthRequired(128);
var password = pwd.Next();
// One Time Passwords
// If you want to return a 4 digit number you can use this:
var pwd = new Password(4).IncludeNumeric();
var password = pwd.Next();
// Specify your own special characters
// You can now specify your own special characters
var pwd = new Password().IncludeLowercase().IncludeUppercase().IncludeNumeric().IncludeSpecial("[]{}^_=");
var password = pwd.Next();
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on PasswordGenerator:

Package Downloads
CocoriCore.Security

Package Description

FEB.ClusterAdmin

API to simplify the administration of a kubernetes cluster

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 Downloads Last updated
2.1.0 115,927 1/4/2022
2.0.5 1,148,001 12/30/2019
2.0.4 8,825 12/16/2019
2.0.3 2,783 12/11/2019
2.0.2 709 12/9/2019
2.0.1 79,976 9/20/2019
2.0.0 11,700 9/4/2019
1.1.3 56,560 6/9/2019
1.1.2 55,343 11/16/2016
1.1.1 1,034 11/13/2016
1.1.0 972 11/13/2016
1.0.0 1,318 11/12/2016

Removed usage of RNG Crypto Provider
Compatible with .NET Core, .NET Framework and .NET Standard
Added ability to get a group of passwords in one call