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

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.

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.

Proudly sponsored by

Moriyama

  • Moriyama build, support and deploy Umbraco, Azure and ASP.NET websites and applications.
AppVeyor

  • CI/CD service for Windows, Linux and macOS
  • Build, test, deploy your apps faster, on any platform.
elmah.io

  • elmah.io is the easy error logging and uptime monitoring service for .NET.
  • Take back control of your errors with support for all .NET web and logging frameworks.
uSync Complete

  • uSync.Complete gives you all the uSync packages, allowing you to completely control how your Umbraco settings, content and media is stored, transferred and managed across all your Umbraco Installations.
uSkinned

  • More than a theme for Umbraco CMS, take full control of your content and design with a feature-rich, award-nominated & content editor focused website platform.
UmbHost

  • Affordable, Geo-Redundant, Umbraco hosting which gives back to the community by sponsoring an Umbraco Open Source Developer with each hosting package sold.