
The next stage is to create a character set based on the parameters in the constructor. Public static string GeneratePassword(bool includeLowercase, bool includeUppercase, bool includeNumeric, bool includeSpecial, bool includeSpaces, int lengthOfPassword) / Bool to say if special characters are required / Bool to say if uppercase are required / Bool to say if lowercase are required / Generates a random password based on the rules passed in the parameters Now we know the above, we can start to create our method. We will add the options for which password rules we would like to enforce on each request, so these will be parameters in the constructor. The method will need to return the password as a string.

There will be a list of available characters to randomly choose from and create the password. We will create single method which you pass parameters into and you get back a password. If you want to skip to the end, you can do so by clicking here

at least 1 special character (punctuation) - do not forget to treat space as special characters too.Password must meet at least 3 out of the following 4 complexity rules.

It can be used to generate random strong passwords and it complies with recommendations from OWASP, including: Requirements See this code in action on my tool Password Generator
RANDOM PASSWORD GENERATOR ALGORITHM HOW TO
In this post I will show you how to create your own password generator in C#.
