Open-source Project: Password Generator

Posted written by Paul Seal on November 22, 2016 C# Modern .NET

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:

<strong>Basic usage</strong>

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


<strong>Fluent usage</strong>

// 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

Watch on YouTube

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.