Check.Password.Strength
1.0.3
dotnet add package Check.Password.Strength --version 1.0.3
NuGet\Install-Package Check.Password.Strength -Version 1.0.3
<PackageReference Include="Check.Password.Strength" Version="1.0.3" />
paket add Check.Password.Strength --version 1.0.3
#r "nuget: Check.Password.Strength, 1.0.3"
// Install Check.Password.Strength as a Cake Addin #addin nuget:?package=Check.Password.Strength&version=1.0.3 // Install Check.Password.Strength as a Cake Tool #tool nuget:?package=Check.Password.Strength&version=1.0.3
Overview
.NET package to check the password strength of a certain passphrase. A password strength checker based from System.Text.RegularExpressions
.
Installation
You can install using the following options: Package Manager
Install-Package Check.Password.Strength
.NET CLI
dotnet add package Check.Password.Strength
PackageReference
<PackageReference Include="Check.Password.Strength" Version="1.0.2" />
Paket CLI
paket add Check.Password.Strength
Setup & Basic Usage
using CheckPasswordStrength;
public class MyClass {
public void Test(){
var password = "mypassword";
var passwordStrength = password.PasswordStrength();
// properties
// Id = 0, Value = "Weak", Length = 10 & contains = [{Message = "lowercase"}]
}
}
Additional Info
Object
Property | Desc. |
---|---|
Id (int) | 0 = Weak, 1 = Medium & 2 = Strong |
Value (string) | Weak, Medium & Strong |
Contains (Collection) | lowercase, uppercase, symbol and/or number |
Length (int) | length of the password |
RegEx
Strong Password RegEx used:
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})
Medium Password RegEx used:
^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[!@#\$%\^&\*])|((?=.*[a-z])(?=.*[!@#\$%\^&\*])|((?=.*[0-9])(?=.*[!@#\$%\^&\*]))(?=.{6,})"
RegEx | Desc. |
---|---|
^ | The password string will start this way |
(?=.*[a-z]) | The string must contain at least 1 lowercase alphabetical character |
(?=.*[A-Z]) | The string must contain at least 1 uppercase alphabetical character |
(?=.*[0-9]) | The string must contain at least 1 numeric character |
(?=.[!@#$%^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict |
(?=.{8,}) | The string must be eight characters or longer |
Other info
If you're working with node.js environment, optionally, you use this package check-password-password. This NPM package uses the same RegEx for checking password strength.
Contribute
Feel free to clone or fork this project: https://github.com/deanilvincent/Check.Password.Strength.git
Contributions & pull requests are welcome!
I'll be glad if you give this project a ★ on Github 😃
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.