What is this?

I recently got interested in contributing to open-source projects after my first pull request was accepted. I enjoyed it so much that I decided to make an open-source library for my password generator. It is a C# .NET project.

I have a password generator tool on my site which anyone can use for free. It generates random, strong passwords for you which are compliant with the OWASP guidelines for password security.

Interesting. How can I use it in my code?

It's great having a tool to go to online and get a random password, but what if you want to generate the password within an application you are building. That is why I created this NuGet package PasswordGenerator.

You can simply add it to your project by using the NuGet Package Manager wizard style user interface, or by typing into Package Manager Console:

Install-Package PasswordGenerator

You will the be able to use it in your project.

You can create passwords between 8 and 128 characters long. They can include uppercase, lowercase, numeric and special characters.

It's really easy to use. Here are some examples:

Basic usage

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


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
PasswordGenerator pwdGen = new PasswordGenerator().IncludeNumeric();
string password = pwdGen.Next();

Find out more in this video

How do I contribute?

If you find a bug or you would like to contribute to the project in any way, please get in touch with me or raise an issue on the GitHub project, before submitting a pull request.

Want to thank me?

If I've helped you out and you want to thank me, why not buy me a coffee?

About the author

Paul Seal

Umbraco MVP and .NET Web Developer from Derby (UK) who specialises in building Content Management System (CMS) websites using MVC with Umbraco as a framework. Paul is passionate about web development and programming as a whole. Apart from when he's with his wife and son, if he's not writing code, he's thinking about it or listening to a podcast about it.

Related Posts

How to include scripts from partial views in MVC and Umbraco

This post will show you how you can include scripts from inside an MVC partial view rather than havi…

Read Post

How to fix the error "Authentication failed because the remote party has closed the transport stream"

This post will show you how to fix the error "Authentication failed because the remote party has clo…

Read Post

How to solve the error Could not load file or assembly System.Security.Principal.Windows

This post help you solve the error System.IO.FileNotFoundException Could not load file or assembly S…

Read Post

How to solve the error "Could not load file or assembly 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0 ..."

This post will show you how to solve the error "Could not load file or assembly 'Microsoft.CodeDom.P…

Read Post