• Stars
    star
    174
  • Rank 218,015 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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();

More Repositories

1

SlackBotMessages

A .NET library to enable you to send bot messages in slack
C#
55
star
2

Umbraco-10-Tutorial

CSS
42
star
3

Package-Script-Writer

Source code for the Package Script Writer tool website
C#
22
star
4

Clean-Starter-Kit-for-Umbraco-v9

JavaScript
22
star
5

Umbraco-v8-Tutorial

HTML
21
star
6

Clean-Starter-Kit-for-Umbraco

A clean bootstrap starter kit for Umbraco
C#
19
star
7

CodeShare-Umbraco-Starter-Kit-for-v8

A Starter Kit for Umbraco v8
HTML
19
star
8

Our.Umbraco.HealthChecks

A collection of Health Checks for Umbraco CMS
CSS
17
star
9

Umbraco-13-Series

CSS
14
star
10

nottsjs.org

A React website for NottsJS powered by Umbraco Rest API
JavaScript
11
star
11

QuickBlocks

A package for Umbraco which builds up your Umbraco block lists and other Umbraco stuff just from your HTML
CSS
11
star
12

Umbraco-9-Membership

A repo to show how to register, login, logout, edit profile, reset password etc in Umbraco v9
C#
11
star
13

CodeShareUmbracoStarterKit

This is for a basic umbraco starter kit
JavaScript
10
star
14

Portfolio-Starter-Kit-fo-Umbraco

C#
8
star
15

Umbraco-Community-Quiz

Source code for the Community Quiz website
JavaScript
8
star
16

Our.Umbraco.DynamicImages

C#
7
star
17

ImageFilter

HTML
6
star
18

Giphy-Property-Editor

A Giphy Property Editor for Umbraco
JavaScript
6
star
19

MyPropertyEditor

A sample property editor for this tutorial. Using Giphy search as an example
JavaScript
4
star
20

Searching-In-Umbraco-v8

JavaScript
4
star
21

TestingUmbracoPerformance

An project set up to test the performance of Umbraco v8
C#
4
star
22

IISExpress-Builder

A PowerShell script, similar to IIS Builder from mattou07 that sets up custom domains for your .NET Core sites in IIS Express
PowerShell
4
star
23

Clean

Clean Starter Kit For Umbraco 13 and Above
CSS
4
star
24

BackOfficeExtensions

This package gives you some helper methods for Umbraco backoffice.
C#
3
star
25

SmallerImages

A library for reducing the size of images when they are uploaded to your umbraco website.
C#
3
star
26

Pronto

A Dashboard Package for Umbraco which aims to speed up your editor's workflow
JavaScript
3
star
27

Spatial-Faceted-Examine-Search

C#
3
star
28

Our.UmbracoUserToDos

A simple to do list user dashboard for Umbraco
JavaScript
2
star
29

Umbraco-Space-Invaders

JavaScript
2
star
30

Umbraco-Media-Puzzle-Game

A content app which is a puzzle game using your media images
JavaScript
2
star
31

Hangfire-Import-Proof-Of-Concept

HTML
2
star
32

PleaseDontGo

JavaScript
2
star
33

Our.Umbraco.EditLink

An umbraco package which gives you link on the front end to edit the page in the backoffice
HTML
1
star
34

Umbraco-OCR

An OCR Content App for Umbraco
JavaScript
1
star
35

Vendr-Tutorial

JavaScript
1
star
36

Example-Starter-Kit-for-Umbraco-v9

C#
1
star
37

Auto-Translate-for-Umbraco

C#
1
star
38

Umbraco-Documentation-Tutorials

A project for me to follow along with the tutorials in the Umbraco Documentation
JavaScript
1
star
39

Codegarden-2022---Umbraco-Packages-Talk

JavaScript
1
star
40

MediaInfo

A content app for umbraco which shows the File Info for your media items
HTML
1
star