Skip to content

djngalja/PasswordStrengthTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

Password Strength Test

Run this Kotlin code to evaluate the strength of your password based on the following criteria:

  • length
  • the number of special characters
  • whether it contains upper case letters, lower case letters and numbers
  • whether it is (or it contains) a common pattern, such as "qwerty", "123123", "abcdef", etc.

Input Format

A string containing a password.

Example:
ADmINadmin3456$SSss

Sample Output

Password length: 19

[x] Digits
[x] Upper case letters
[x] Lower case letters
[x] 1 special character(s)

[!] Common pattern 'ADmIN' found
[!] Common pattern 'admin' found
[!] Common pattern 'SSss' found
[!] Common pattern '3456' found

TOTAL SCORE: 2 (very weak)

Common Patterns

The following password patterns are taken into account:

Pattern description Examples
Arithmetic sequences with common differences of 1 or -1 1234 65432
Sequences of letters in (reverse) alphabetical order abcd dcba hIjkLmN
Sequences of repeating characters GGGG _____ 6666 AAAAaa
Sequence of repeating pairs of characters 121212 HAHa *+*+*+
Common password patterns qwerty admin PassWorD

Only sequences longer than 3 characters are detected. No search algorithm is not case-sensitive.

Scoring System

Score Password Strength
< 3 very weak
3 - 4 weak
5 - 6 medium
7 - 8 strong
> 8 very strong

Total score is calculated based on the following rules:

+1 point for every 8 characters (password length)
+1 point for numbers
+1 point for upper case letters
+1 point for lower case letters
+1 point for every special character (characters that are not letters or digits)
-1 point for every common pattern

About

[Kotlin] Check the strength of your password here!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages