PasswordGenerator 2.1.0

.NET Standard 2.0
dotnet add package PasswordGenerator --version 2.1.0
NuGet\Install-Package PasswordGenerator -Version 2.1.0
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="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
#r "nuget: PasswordGenerator, 2.1.0"
#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=2.1.0

// Install PasswordGenerator as a Cake Tool
#tool nuget:?package=PasswordGenerator&version=2.1.0

Password Generator

Password Logo

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


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 net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.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 net481
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 (6)

Showing the top 5 NuGet packages that depend on PasswordGenerator:

Package Downloads

Package Description


API to simplify the administration of a kubernetes cluster

Rbit.Common The ID prefix of this package has been reserved for one of the owners of this package by

Provides RBIT libraries commonly used in new projects.


The utilities of OLMI framework.


Create password for apps (ASP.NET Core & Xamarin & Desktop ...)

GitHub repositories (2)

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

Repository Stars
Stealer + Clipper + Keylogger
🔑 Simple notepad for Windows with encryption features
Version Downloads Last updated
2.1.0 980,814 1/4/2022
2.0.5 1,576,651 12/30/2019
2.0.4 10,446 12/16/2019
2.0.3 3,091 12/11/2019
2.0.2 879 12/9/2019
2.0.1 91,614 9/20/2019
2.0.0 13,861 9/4/2019
1.1.3 57,251 6/9/2019
1.1.2 61,214 11/16/2016
1.1.1 1,203 11/13/2016
1.1.0 1,135 11/13/2016
1.0.0 1,599 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