All Projects → angular-material-extensions → Password Strength

angular-material-extensions / Password Strength

Licence: mit
Angular UI library to illustrate and validate a password's strength with material design - Angular V9 supported

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Password Strength

Probable Wordlists
Version 2 is live! Wordlists sorted by probability originally created for password generation and testing - make sure your passwords aren't popular!
Stars: ✭ 7,312 (+3831.18%)
Mutual labels:  password, password-strength, password-safety
Bewgor
Bull's Eye Wordlist Generator - Does your password rely on predictable patterns of accessible info?
Stars: ✭ 333 (+79.03%)
Mutual labels:  password, password-strength, password-safety
Kaonashi
Wordlist, rules and masks from Kaonashi project (RootedCON 2019)
Stars: ✭ 353 (+89.78%)
Mutual labels:  password, password-strength, password-safety
password-list
Password lists with top passwords to optimize bruteforce attacks
Stars: ✭ 174 (-6.45%)
Mutual labels:  password, password-strength, password-safety
Passwordpusher
🔐 PasswordPusher is an application to securely communicate passwords over the web. Passwords automatically expire after a certain number of views and/or time has passed.
Stars: ✭ 484 (+160.22%)
Mutual labels:  password, password-safety
Passwordedittext
A custom EditText with a switchable icon which shows or hides the password
Stars: ✭ 430 (+131.18%)
Mutual labels:  password, material
Passgan
A Deep Learning Approach for Password Guessing (https://arxiv.org/abs/1709.00440)
Stars: ✭ 704 (+278.49%)
Mutual labels:  password, password-strength
Dumb Passwords
Don't let your user be a victim of their own action
Stars: ✭ 77 (-58.6%)
Mutual labels:  password-strength, password-safety
Fabsmenu
A simple library to use a menu of FloatingActionButtons from Design Support Library that follow Material Design Guidelines
Stars: ✭ 324 (+74.19%)
Mutual labels:  material, materialdesign
Breeze
A Material Design game launcher for Windows
Stars: ✭ 22 (-88.17%)
Mutual labels:  material, materialdesign
Materialdesigndemo
A beautiful app designed with Material Design.
Stars: ✭ 1,391 (+647.85%)
Mutual labels:  material, materialdesign
Passmaker
可以自定义规则的密码字典生成器,支持图形界面 A password-generator that base on the rules that you specified
Stars: ✭ 363 (+95.16%)
Mutual labels:  password, password-safety
Passpwn
See if your passwords in pass has been breached.
Stars: ✭ 130 (-30.11%)
Mutual labels:  password, password-safety
Vue Password Strength Meter
🔐 Password strength meter based on zxcvbn in vue.js
Stars: ✭ 510 (+174.19%)
Mutual labels:  password, password-safety
Passwordstrengthbundle
Symfony Password strength and blacklisting validator bundle
Stars: ✭ 123 (-33.87%)
Mutual labels:  password, password-strength
Cupp
The most common form of authentication is the combination of a username and a password or passphrase. If both match values stored within a locally stored table, the user is authenticated for a connection. Password strength is a measure of the difficulty involved in guessing or breaking the password through cryptographic techniques or library-based automated testing of alternate values.
Stars: ✭ 2,493 (+1240.32%)
Mutual labels:  password, password-strength
React Password Strength
A password strength indicator field for use in React projects
Stars: ✭ 167 (-10.22%)
Mutual labels:  password, password-strength
RockYou2021.txt
RockYou2021.txt is a MASSIVE WORDLIST compiled of various other wordlists. RockYou2021.txt DOES NOT CONTAIN USER:PASS logins!
Stars: ✭ 288 (+54.84%)
Mutual labels:  password-strength, password-safety
laravel-pwned-passwords
Simple Laravel validation rule that allows you to prevent or limit the re-use of passwords that are known to be pwned (unsafe). Based on TroyHunt's Have I Been Pwned (https://haveibeenpwned.com)
Stars: ✭ 67 (-63.98%)
Mutual labels:  password, password-safety
Android Complexify
An Android library which makes checking the quality of user's password a breeze.
Stars: ✭ 111 (-40.32%)
Mutual labels:  password, password-strength

angular-material-extensions's logo

@angular-material-extensions/password-strength - Material password strength meter to indicate how secure is the provided password - Angular V11 supported incl. schematics

npm version npm demo docs: typedoc Join the chat at https://gitter.im/angular-material-extensions/Lobby CircleCI branch Build Status codecov dependency Status devDependency Status Greenkeeper Badge license Awesome

@angular-material-extensions/password-strength demonstration

Built by and for developers ❤️

Do you have any question or suggestion ? Please do not hesitate to contact us! Alternatively, provide a PR | open an appropriate issue here

If you like this project, support angular-material-extensions by starring ⭐️ and sharing it 📢

Table of Contents

Demo

View all the directives and components in action at https://angular-material-extensions.github.io/password-strength

Library's components

  • <mat-password-strength> used to calculate and display the strength of a provided password
  1. strength score <= 20%

@angular-material-extensions/password-strength score less than 20%

  1. strength score <= 80%

@angular-material-extensions/password-strength score less than 40%

  1. strength score > 80%

@angular-material-extensions/password-strength score less than 100%

  • <mat-password-strength-info> used to display more information about the strength of a provided password

@angular-material-extensions/password-strength's info

  • <mat-pass-toggle-visibility> used to show/hide the password provided in the input element

@angular-material-extensions/password-strength's info


Dependencies

  • Angular developed and tested with 11.x

Installation

1. Install via ng add. (Recommended)

If Angular Material Design is not setup, just run ng add @angular/material learn more

Now add the library via the angular schematics

ng add @angular-material-extensions/password-strength

2. Install via npm. (Alternative)

Now install @angular-material-extensions/password-strength via:

npm install --save @angular-material-extensions/password-strength

SystemJS

Note:If you are using SystemJS, you should adjust your configuration to point to the UMD bundle. In your systemjs config file, map needs to tell the System loader where to look for @angular-material-extensions/password-strength:

{
  '@angular-material-extensions/password-strength';: 'node_modules/@angular-material-extensions/password-strength/bundles/password-strength.umd.js',
}

-> follow the instructions here


Import the library

Once installed you need to import the main module:

import { MatPasswordStrengthModule } from '@angular-material-extensions/password-strength';

The only remaining part is to list the imported module in your application module. The exact method will be slightly different for the root (top-level) module for which you should end up with the code similar to (notice MatPasswordStrengthModule .forRoot()):

import { MatPasswordStrengthModule } from '@angular-material-extensions/password-strength';

@NgModule({
  declarations: [AppComponent, ...],
  imports: [MatPasswordStrengthModule.forRoot(), ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

Other modules in your application can simply import MatPasswordStrengthModule:

import { MatPasswordStrengthModule } from '@angular-material-extensions/password-strength';

@NgModule({
  declarations: [OtherComponent, ...],
  imports: [MatPasswordStrengthModule, ...], 
})
export class OtherModule {
}

API

<mat-password-strength> used to calculate and display the strength of a provided password - see the demo examples

option bind type default description
password Input() string - the password to calculate its strength
customValidator Input() RegExp - custom regex validator
externalError Input() boolean false used to change the color of the password to warn if an external error occurs
enableLengthRule Input() boolean true whether to validate the length of the password
enableLowerCaseLetterRule Input() boolean true whether a lowercase letter is optional
enableUpperCaseLetterRule Input() boolean true whether a uppercase letter is optional
enableDigitRule Input() boolean true whether a digit char is optional
enableSpecialCharRule Input() boolean true whether a special char is optional
min Input() number 8 the minimum length of the password
max Input() number 30 the maximum length of the password
warnThreshold Input() number 21 password strength less than this number shows the warn color
accentThreshold Input() number 81 password strength less than this number shows the accent color
onStrengthChanged Output() number - emits the strength of the provided password in % e.g: 20%, 40%, 60%, 80% or 100%

<mat-password-strength-info> used to display more information about the strength of a provided password - see the demo examples

option bind type default description
passwordComponent Input() PasswordStrengthComponent - the password component used in the template in order to display more info related to the provided password
enableScoreInfo Input() boolean false whether to show the password's score in %
lowerCaseCriteriaMsg Input() string contains at least one lower character an appropriate msg for the lower case %
upperCaseCriteriaMsg Input() string contains at least one upper character an appropriate msg for the upper case %
digitsCriteriaMsg Input() string contains at least one digit character an appropriate msg for the digit case %
specialCharsCriteriaMsg Input() string contains at least one special character an appropriate msg for the special case %
customCharsCriteriaMsg Input() string contains at least one custom character an appropriate msg for the custom validator case %
minCharsCriteriaMsg Input() string contains at least ${this.passwordComponent.min} characters an appropriate msg for the minimum number of chars %

<mat-pass-toggle-visibility> used to show/hide the password provided in the input element

option bind type default description
isVisible Input() boolean false whether the password is visible or hidden

Usage

add the @angular-material-extensions/password-strength element to your template:

<mat-password-strength  [password]="password.value">
</mat-password-strength>

This will display only the material password strength meter in form of a progress without any input fields or similar.

In the following example, we integration a material input container with @angular-material-extensions/password-strength 's component.

NOTE: In order to repaint the mat-form-field correctly after changing the value of the password's strength, please consider to change the detection strategy for the parent component -->

import {ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {MatSlideToggleChange} from '@angular/material';
import {MatPasswordStrengthComponent} from '@angular-material-extensions/password-strength';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss'],
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomeComponent implements OnInit {}
<div>
  <mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color">
              <mat-label>Password</mat-label>
              <input matInput #password
                     [type]="inputType"
                     required
                     placeholder="Password">
              <mat-hint align="end" aria-live="polite">
                {{password.value.length}} / 25
              </mat-hint>
            </mat-form-field>
  
            <mat-password-strength #passwordComponent
                                   (onStrengthChanged)="onStrengthChanged($event)"
                                   [password]="password.value">
            </mat-password-strength>
     </div>

learn more about mat-form-field

Example of how to use the emitted strength of the password in your template

<div fxLayout="row" fxLayoutGap="10px">
   <div *ngIf="passwordComponent.strength === 100; then done else error">
   </div>
   <ng-template #done>
     <mat-icon color="primary">done</mat-icon>
   </ng-template>
   <ng-template #error>
     <mat-icon color="warn">error</mat-icon>
   </ng-template>
   <div>
     <p>Password's strength = {{passwordComponent.strength}} %100</p>
   </div>
</div>

Use the toggle visibility component

  • add the mat-pass-toggle-visibility to your mat-form-field
  • give it a name to use it in the html file like toggle
  • set the type of the input to that value emitted from the mat-pass-toggle-visibility component <input matInput [type]="toggle.type"/>
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color">
  <mat-label>Password</mat-label>
  <!-- HERE DOWN :D-->
  <mat-pass-toggle-visibility #toggle matSuffix></mat-pass-toggle-visibility>
  <!-- THERE ABOVE ;)-->
  <input matInput #password
         [type]="toggle.type"
         required
         placeholder="Password">
  <mat-hint align="end" aria-live="polite">
    {{password.value.length}} / 25
  </mat-hint>
</mat-form-field>

Client Side password's validation using a built in angular formController

  1. add an input element to your template with an appropriate @angular-material-extensions/password-strength's component
  2. hold a reference of the @angular-material-extensions/password-strength's component by adding passwordComponentWithValidation (or whatever you want) inside the element

e.g:

 <mat-password-strength #passwordComponentWithValidation
                       [password]="passwordWithValidation.value">
                       </mat-password-strength>
  1. bind the form controller of the mat-password-strength to the input element
  • you can access the form controller of @angular-material-extensions/password-strength using the chile view --> passwordComponentWithValidation.passwordFormControl
  • bind the form controller to an input element --> [formControl]="passwordComponentWithValidation.passwordFormControl"
  1. Full example - see below
<div>
  <mat-form-field appearance="outline" style="width: 100%">
    <mat-label>Password</mat-label>
    <input matInput #passwordWithValidation
           [type]="inputType"
           required
           [formControl]="passwordComponentWithValidation.passwordFormControl"
           placeholder="Password">
    <mat-hint align="end" aria-live="polite">
      {{passwordWithValidation.value.length}} / 25
    </mat-hint>
    <mat-error *ngIf="passwordComponentWithValidation.passwordFormControl.hasError('required')">
      Password is required
    </mat-error>
    <mat-error *ngIf="passwordComponentWithValidation.passwordFormControl.hasError('pattern')">
      Password is not valid
    </mat-error>
  </mat-form-field>
  <mat-password-strength #passwordComponentWithValidation
                                  (onStrengthChanged)="onStrengthChanged($event)"
                                  [password]="passwordWithValidation.value">
  </mat-password-strength>
  <!--Password's strength info-->
  <mat-password-strength-info
    [passwordComponent]="passwordComponentWithValidation">
  </mat-password-strength-info>
</div>

this will looks like -->

@angular-material-extensions/password-strength


custom regex validation

please consider to use the customValidator input (see below)

<mat-slide-toggle #toggle>Show Password Details</mat-slide-toggle>
      
 <mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent.color">
  <mat-label>Password</mat-label>
  <mat-pass-toggle-visibility #toggleVisbility matSuffix></mat-pass-toggle-visibility>
  <input matInput #password
         [type]="toggleVisbility.type"
         placeholder="Password">
  <mat-hint align="end" aria-live="polite">
    {{password.value.length}} / {{passwordComponent.max}}
  </mat-hint>
</mat-form-field>
 
        
<mat-password-strength #passwordComponent
  (onStrengthChanged)="onStrengthChanged($event)"
  [password]="password.value"
  [customValidator]="pattern">
</mat-password-strength>

<mat-password-strength-info
  *ngIf="toggle.checked"
  [passwordComponent]="passwordComponent6"
  customCharsCriteriaMsg="1 german special chars is required"
  [enableScoreInfo]="true">
</mat-password-strength-info>

pattern = new RegExp(/^(?=.*?[äöüÄÖÜß])/);

Confirm the password with built in angular form controllers - see the live example

@angular-material-extensions/password-strength with confirmation feature

@angular-material-extensions/password-strength with confirmation feature

Use always the green color for a strong password just by adding the green css class to the mat-password-strength

<mat-password-strength #passwordComponent
                       class="green"
                       [password]="password.value">
</mat-password-strength>

Supporting custom messages and ngx-translate for the info component please check the example demo here

@angular-material-extensions/password-strength demonstration

for more examples please visit this URL : [(https://angular-material-extensions.github.io/password-strength/examples]((https://angular-material-extensions.github.io/password-strength/examples)

Please checkout the full documentation here or follow the official tutorial


Run Demo App Locally

Development

Other Angular Libraries


Support

Built by and for developers ❤️ we will help you 👊


jetbrains logo

This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm


License

Copyright (c) 2019-2020 Anthony Nahas. Licensed under the MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].