Basic Password Strength Meter

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Basic Password Strength Meter

Post by Rain » Mon Jul 15, 2013 1:42 pm

This script is designed to determine the strength of a password. Since there is no official standard, I created my own formula to determine the strength of a given password.

This script is neither perfect nor foolproof, and should only be utilized as a loose guide in determining methods for improving the password creation process.

Written with Macro Scheduler 13.

Image

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'Basic Password Meter by Rain'
  ClientHeight = 390
  ClientWidth = 456
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 8
    Top = 80
    Width = 241
    Height = 305
    AutoSize = False
    Caption = 'Label1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label2: TLabel
    Left = 8
    Top = 56
    Width = 57
    Height = 13
    Caption = 'Too Short'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 264
    Top = 8
    Width = 185
    Height = 105
    AutoSize = False
    Caption = 
      'Minimum Requirements'#13#10#13#10'Minimum 8 characters in length'#13#10'Contains' +
      ' following:'#13#10'- Uppercase Letters'#13#10'- Lowercase Letters'#13#10'- Numbers' +
      #13#10'- Symbols'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label4: TLabel
    Left = 256
    Top = 136
    Width = 76
    Height = 13
    Caption = 'DISCLAIMER'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Edit1: TEdit
    Left = 8
    Top = 8
    Width = 172
    Height = 21
    TabOrder = 0
  end
  object ProgressBar1: TProgressBar
    Left = 8
    Top = 32
    Width = 242
    Height = 17
    Max = 500
    TabOrder = 1
  end
  object MSButton1: tMSButton
    Left = 180
    Top = 8
    Width = 69
    Height = 21
    Caption = 'Check'
    TabOrder = 2
    DoBrowse = False
    BrowseStyle = fbOpen
  end
  object MSMemo1: tMSMemo
    Left = 256
    Top = 152
    Width = 193
    Height = 233
    Lines.Strings = (
      'This application is designed to '
      'assess the strength of password '
      'strings. The instantaneous visual '
      'feedback provides the user a '
      'means to improve the strength of '
      'their passwords, with a hard focus '
      'on breaking the typical bad habits '
      'of faulty password formulation. '
      'Since no official weighting system '
      'exists, I created my own formulas to '
      'assess the overall strength of a '
      'given password. Please note, that '
      'this application does not utilize the '
      'typical "days-to-crack" approach for '
      'strength determination. I have found '
      'that particular system to be severely '
      'lacking and unreliable for real-world '
      'scenarios. This application is neither '
      'perfect nor foolproof, and should '
      'only be utilized as a loose guide in '
      'determining methods for improving '
      'the password creation process.')
    ScrollBars = ssVertical
    TabOrder = 3
    Text = 
      'This application is designed to assess the strength of password ' +
      'strings. The instantaneous visual feedback provides the user a m' +
      'eans to improve the strength of their passwords, with a hard foc' +
      'us on breaking the typical bad habits of faulty password formula' +
      'tion. Since no official weighting system exists, I created my ow' +
      'n formulas to assess the overall strength of a given password. P' +
      'lease note, that this application does not utilize the typical "' +
      'days-to-crack" approach for strength determination. I have found' +
      ' that particular system to be severely lacking and unreliable fo' +
      'r real-world scenarios. This application is neither perfect nor ' +
      'foolproof, and should only be utilized as a loose guide in deter' +
      'mining methods for improving the password creation process.'
  end
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,MSButton1,OnClick,GetPassStrength
AddDialogHandler>Dialog1,Edit1,OnChange,GetPassStrength
SetDialogProperty>Dialog1,Label1,Caption,Password Strength: 0%CRLF%%CRLF%Password Score Additions%CRLF%Number of Chracters: 0%CRLF%Uppercase Letters: 0%CRLF%Lowercase Letters: 0%CRLF%Numbers: 0%CRLF%Symbols: 0%CRLF%Requirements: 0%CRLF%%CRLF%Password Score Deductions%CRLF%Letters Only: 0%CRLF%Numbers Only: 0%CRLF%Repeat Characters (Case Insensitive): 0%CRLF%Uppercase Only: 0%CRLF%Lowercase Only: 0%CRLF%Consecutive Uppercase Letters: 0%CRLF%Consecutive Lowercase Letters: 0%CRLF%Consecutive Numbers: 0%CRLF%Sequential Numbers (3+): 0%CRLF%Sequential Letters (3+): 0%CRLF%Repeated Numbers And Letters: 0%CRLF%E.g. AA%comma% aa%comma% 11%comma% 22 (Case Sensitive)
SetDialogProperty>Dialog1,MSMemo1,WordWrap,True

Show>Dialog1,


SRT>GetPassStrength
GetDialogProperty>Dialog1,Edit1,Text,ThEgenPaSsWord

Length>%ThEgenPaSsWord%,nPassScoreLength
IF>nPassScoreLength>3
Let>nTotalScore=%nPassScoreLength%*4
ELSE
Let>nTotalScore=0
ENDIF

Let>PassString=%ThEgenPaSsWord%
//Set Default values
Let>nRepeatNumeric=0
Let>nTotalNumeric=0
Let>nRepeatUpper=0
Let>nRepeatLetters=0
Let>nTotalUpper=0
Let>nRepeatLower=0
Let>nTotalLower=0
Let>nSpecial=0
Let>nRepeatSpecial=0
Let>nSpecialUG=0
Let>nRepeatSpecialUG=0
Let>nSpecialSpace=0
Let>nRepeatSpecialSpace=0
Let>nTotalSpecial=0
Let>nLettersOnly=0
Let>nNumbersOnly=0
LET>nMinRequirements=0
Let>nTotalRepeatCharacter=0
Let>nSequentialNumbers3=0
Let>nSequentialNumbers4=0
Let>nSequentialNumbers5=0
Let>nSequentialNumbers6=0
Let>nSequentialNumbers7=0
Let>nSequentialNumbers8=0
Let>nSequentialNumbers9=0
Let>nSequentialNumbers0=0
Let>nTotalSequentialNumbers=0
Let>nSequentialLetters3=0
Let>nSequentialLetters4=0
Let>nSequentialLetters5=0
Let>nSequentialLetters6=0
Let>nSequentialLetters7=0
Let>nSequentialLetters8=0
Let>nSequentialLetters9=0
Let>nSequentialLetters10=0
Let>nSequentialLetters11=0
Let>nSequentialLetters12=0
Let>nSequentialLetters13=0
Let>nSequentialLetters14=0
Let>nSequentialLetters15=0
Let>nSequentialLetters16=0
Let>nSequentialLetters17=0
Let>nSequentialLetters18=0
Let>nSequentialLetters19=0
Let>nSequentialLetters20=0
Let>nSequentialLetters21=0
Let>nSequentialLetters22=0
Let>nSequentialLetters23=0
Let>nSequentialLetters24=0
Let>nSequentialLetters25=0
Let>nSequentialLetters26=0
Let>nTotalSequentialLetters=0
Let>nTotalLetters=0
Let>nUpperOnly=0
Let>nLowerOnly=0
Let>nRepeatedNumLetters=0


//Check if Number are repeated
RegEx>[0-9]{2},PassString,0,matches,nRepeatNumeric,0
Sub>nTotalScore,%nRepeatNumeric%

//Check total number
RegEx>[0-9]{1},PassString,0,matches,nTotalNumeric,0
Add>nTotalScore,%nTotalNumeric%

//Check IF Upper case is repeated
RegEx>(?-i)[A-Z]{2},PassString,0,matches,nRepeatUpper,0
Sub>nTotalScore,%nRepeatUpper%

//Check total upper case
RegEx>(?-i)[A-Z]{1},PassString,0,matches,nTotalUpper,0
Add>nTotalScore,%nTotalUpper%

//Check IF Lower case is repeated
RegEx>(?-i)[a-z]{2},PassString,0,matches,nRepeatLower,0
Sub>nTotalScore,%nRepeatLower%

//Check total lower case
RegEx>(?-i)[a-z]{1},PassString,0,matches,nTotalLower,0
Add>nTotalScore,%nTotalLower%

//Count total letters
Let>nTotalLetters=%nTotalUpper%+%nTotalLower%

//Check if Uppercase Only
IF>%nTotalLetters%=%nTotalUpper%
Let>nUpperOnly=%nTotalUpper%
Sub>nTotalScore,%nTotalLetters%
ENDIF


//Check if Lowercase Only
IF>%nTotalLetters%=%nTotalLower%
Let>nLowerOnly=%nTotalLower%
Sub>nTotalScore,%nTotalLetters%
ENDIF


//Check if letters repeat (Not Case Sensitive)
RegEx>[A-Z]{2},PassString,0,matches,nRepeatLetters,0
Sub>nTotalScore,%nRepeatLetters%
Add>nTotalRepeatCharacter,%nRepeatLetters%


//Check for special characters
RegEx>[^\w\s]{1},PassString,0,matches,nSpecial,0
Add>nTotalSpecial,%nSpecial%

//Check for special characters "Underscore"
RegEx>[_]{1},PassString,0,matches,nSpecialUG,0
Add>nTotalSpecial,%nSpecialUG%

//Check for special characters "Space"
RegEx>[%SPACE%]{1},PassString,0,matches,nSpecialSpace,0
Add>nTotalSpecial,%nSpecialSpace%

//Check for Repeat special characters
RegEx>[^\w\s]{2},PassString,0,matches,nRepeatSpecial,0
Sub>nTotalScore,%nRepeatSpecial%
Add>nTotalRepeatCharacter,%nRepeatSpecial%

//Check for Repeat special characters Underscore
RegEx>[_]{2},PassString,0,matches,nRepeatSpecialUG,0
Sub>nTotalScore,%nRepeatSpecialUG%
Add>nTotalRepeatCharacter,%nSpecialUG%

//Check for Repeat special characters "Space"
RegEx>[%SPACE%]{2},PassString,0,matches,nRepeatSpecialSpace,0
Sub>nTotalScore,%nRepeatSpecialSpace%
Add>nTotalRepeatCharacter,%nSpecialSpace%




//Check for repeated numbers and letters
Let>Pattern=(?-i)(11|111|22|222|33|333|44|444|55|555|66|666|77|777|88|888|99|999|00|000|aa|aaa|bb|bbb|cc|ccc|dd|ddd|ee|eee|ff|fff|gg|ggg|hh|hhh|ii|iii|jj|jjj|kk|kkk|ll|lll|mm|mmm|nn|nnn|oo|ooo|pp|ppp|qq|qqq|rr|rrr|ss|sss|tt|ttt|uu|uuu|vv|vvv|ww|www|xx|xxx|yy|yyy|zz|zzz|AA|AAA|BB|BBB|CC|CCC|DD|DDD|EE|EEE|FF|FFF|GG|GGG|HH|HHH|II|III|JJ|JJJ|KK|KKK|LL|LLL|MM|MMM|NN|NNN|OO|OOO|PP|PPP|QQ|QQQ|RR|RRR|SS|SSS|TT|TTT|UU|UUU|VV|VVV|WW|WWW|XX|XXX|YY|YYY|ZZ|ZZZ)
RegEx>Pattern,PassString,0,matches,nRepeatedNumLetters,0
Sub>nTotalScore,%nRepeatedNumLetters%


//Check for 3 Sequential Numbers
Let>Pattern=(012|123|234|345|456|567|678|789|890|210|321|432|543|654|765|876|987|098|111|222|333|444|555|666|777|888|999|000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers3,0
Sub>nTotalScore,%nSequentialNumbers3%
Add>nTotalSequentialNumbers,%nSequentialNumbers3%

//Check for 4 Sequential Numbers
Let>Pattern=(0123|1234|2345|3456|4567|5678|6789|3210|4321|5432|6543|7654|8765|9876|1111|2222|3333|4444|5555|6666|7777|8888|9999|0000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers4,0
Sub>nTotalScore,%nSequentialNumbers4%
Add>nTotalSequentialNumbers,%nSequentialNumbers4%

//Check for 5 Sequential Numbers
Let>Pattern=(01234|12345|23456|34567|45678|56789|67890|09876|98765|87654|76543|65432|54321|43210|11111|22222|33333|44444|55555|66666|77777|88888|99999|00000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers5,0
Sub>nTotalScore,%nSequentialNumbers5%
Add>nTotalSequentialNumbers,%nSequentialNumbers5%

//Check for 6 Sequential Numbers
Let>Pattern=(012345|123456|234567|345678|456789|567890|098765|987654|876543|765432|654321|543210|111111|222222|333333|444444|555555|666666|777777|888888|999999|000000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers6,0
Sub>nTotalScore,%nSequentialNumbers6%
Add>nTotalSequentialNumbers,%nSequentialNumbers6%

//Check for 7 Sequential Numbers
Let>Pattern=(0123456|1234567|2345678|3456789|4567890|0987654|9876543|8765432|7654321|6543210|1111111|2222222|3333333|4444444|5555555|6666666|7777777|8888888|9999999|0000000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers7,0
Sub>nTotalScore,%nSequentialNumbers7%
Add>nTotalSequentialNumbers,%nSequentialNumbers7%

//Check for 8 Sequential Numbers
Let>Pattern=(01234567|12345678|23456789|34567890|09876543|98765432|87654321|76543210|11111111|22222222|33333333|44444444|55555555|66666666|77777777|88888888|99999999|00000000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers8,0
Sub>nTotalScore,%nSequentialNumbers8%
Add>nTotalSequentialNumbers,%nSequentialNumbers8%

//Check for 9 Sequential Numbers
Let>Pattern=(012345678|123456789|234567890|098765432|987654321|876543210|111111111|222222222|333333333|444444444|555555555|666666666|777777777|888888888|999999999|000000000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers9,0
Sub>nTotalScore,%nSequentialNumbers9%
Add>nTotalSequentialNumbers,%nSequentialNumbers9%

//Check for 10 Sequential Numbers
Let>Pattern=(0123456789|1234567890|0987654321|9876543210|1111111111|2222222222|3333333333|4444444444|5555555555|6666666666|7777777777|8888888888|9999999999|0000000000)
RegEx>Pattern,PassString,0,matches,nSequentialNumbers10,0
Sub>nTotalScore,%nSequentialNumbers10%
Add>nTotalSequentialNumbers,%nSequentialNumbers10%




//Check for 3 Sequential Letters
Let>Pattern=(abc|bcd|cde|def|efg|fgh|ghi|hij|ijk|jkl|klm|lmn|mno|nop|opq|pqr|qrs|rst|stu|tuv|uvw|vwx|wxy|xyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters3,0
Sub>nTotalScore,%nSequentialLetters3%
Add>nTotalSequentialLetters,%nSequentialLetters3%

//Check for 4 Sequential Letters
Let>Pattern=(abcd|bcde|cdef|defg|efgh|fghi|ghij|hijk|ijkl|jklm|klmn|lmno|mnop|nopq|opqr|pqrs|qrst|rstu|stuv|tuvw|uvwx|vwxy|wxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters4,0
Sub>nTotalScore,%nSequentialLetters4%
Add>nTotalSequentialLetters,%nSequentialLetters4%

//Check for 5 Sequential Letters
Let>Pattern=(abcde|bcdef|cdefg|defgh|efghi|fghij|ghijk|hijkl|ijklm|jklmn|klmno|lmnop|mnopq|nopqr|opqrs|pqrst|qrstu|rstuv|stuvw|tuvwx|uvwxy|vwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters5,0
Sub>nTotalScore,%nSequentialLetters5%
Add>nTotalSequentialLetters,%nSequentialLetters5%

//Check for 6 Sequential Letters
Let>Pattern=(abcdef|bcdefg|cdefgh|defghi|efghij|fghijk|ghijkl|hijklm|ijklmn|jklmno|klmnop|lmnopq|mnopqr|nopqrs|opqrst|pqrstu|qrstuv|rstuvw|stuvwx|tuvwxy|uvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters6,0
Sub>nTotalScore,%nSequentialLetters6%
Add>nTotalSequentialLetters,%nSequentialLetters6%

//Check for 7 Sequential Letters
Let>Pattern=(abcdefg|bcdefgh|cdefghi|defghij|efghijk|fghijkl|ghijklm|hijklmn|ijklmno|jklmnop|klmnopq|lmnopqr|mnopqrs|nopqrst|opqrstu|pqrstuv|qrstuvw|rstuvwx|stuvwxy|tuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters7,0
Sub>nTotalScore,%nSequentialLetters7%
Add>nTotalSequentialLetters,%nSequentialLetters7%

//Check for 8 Sequential Letters
Let>Pattern=(abcdefgh|bcdefghi|cdefghij|defghijk|efghijkl|fghijklm|ghijklmn|hijklmno|ijklmnop|jklmnopq|klmnopqr|lmnopqrs|mnopqrst|nopqrstu|opqrstuv|pqrstuvw|qrstuvwx|rstuvwxy|stuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters8,0
Sub>nTotalScore,%nSequentialLetters8%
Add>nTotalSequentialLetters,%nSequentialLetters8%

//Check for 9 Sequential Letters
Let>Pattern=(abcdefghi|bcdefghij|cdefghijk|defghijkl|efghijklm|fghijklmn|ghijklmno|hijklmnop|ijklmnopq|jklmnopqr|klmnopqrs|lmnopqrst|mnopqrstu|nopqrstuv|opqrstuvw|pqrstuvwx|qrstuvwxy|rstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters9,0
Sub>nTotalScore,%nSequentialLetters9%
Add>nTotalSequentialLetters,%nSequentialLetters9%

//Check for 10 Sequential Letters
Let>Pattern=(abcdefghij|bcdefghijk|cdefghijkl|defghijklm|efghijklmn|fghijklmno|ghijklmnop|hijklmnopq|ijklmnopqr|jklmnopqrs|klmnopqrst|lmnopqrstu|mnopqrstuv|nopqrstuvw|opqrstuvwx|pqrstuvwxy|qrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters10,0
Sub>nTotalScore,%nSequentialLetters10%
Add>nTotalSequentialLetters,%nSequentialLetters10%

//Check for 11 Sequential Letters
Let>Pattern=(abcdefghijk|bcdefghijkl|cdefghijklm|defghijklmn|efghijklmno|fghijklmnop|ghijklmnopq|hijklmnopqr|ijklmnopqrs|jklmnopqrst|klmnopqrstu|lmnopqrstuv|mnopqrstuvw|nopqrstuvwx|opqrstuvwxy|pqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters11,0
Sub>nTotalScore,%nSequentialLetters11%
Add>nTotalSequentialLetters,%nSequentialLetters11%

//Check for 12 Sequential Letters
Let>Pattern=(abcdefghijkl|bcdefghijklm|cdefghijklmn|defghijklmno|efghijklmnop|fghijklmnopq|ghijklmnopqr|hijklmnopqrs|ijklmnopqrst|jklmnopqrstu|klmnopqrstuv|lmnopqrstuvw|mnopqrstuvwx|nopqrstuvwxy|opqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters12,0
Sub>nTotalScore,%nSequentialLetters12%
Add>nTotalSequentialLetters,%nSequentialLetters12%

//Check for 13 Sequential Letters
Let>Pattern=(abcdefghijklm|bcdefghijklmn|cdefghijklmno|defghijklmnop|efghijklmnopq|fghijklmnopqr|ghijklmnopqrs|hijklmnopqrst|ijklmnopqrstu|jklmnopqrstuv|klmnopqrstuvw|lmnopqrstuvwx|mnopqrstuvwxy|nopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters13,0
Sub>nTotalScore,%nSequentialLetters13%
Add>nTotalSequentialLetters,%nSequentialLetters13%

//Check for 14 Sequential Letters
Let>Pattern=(abcdefghijklmn|bcdefghijklmno|cdefghijklmnop|defghijklmnopq|efghijklmnopqr|fghijklmnopqrs|ghijklmnopqrst|hijklmnopqrstu|ijklmnopqrstuv|jklmnopqrstuvw|klmnopqrstuvwx|lmnopqrstuvwxy|mnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters14,0
Sub>nTotalScore,%nSequentialLetters14%
Add>nTotalSequentialLetters,%nSequentialLetters14%

//Check for 15 Sequential Letters
Let>Pattern=(abcdefghijklmno|bcdefghijklmnop|cdefghijklmnopq|defghijklmnopqr|efghijklmnopqrs|fghijklmnopqrst|ghijklmnopqrstu|hijklmnopqrstuv|ijklmnopqrstuvw|jklmnopqrstuvwx|klmnopqrstuvwxy|lmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters15,0
Sub>nTotalScore,%nSequentialLetters15%
Add>nTotalSequentialLetters,%nSequentialLetters15%

//Check for 16 Sequential Letters
Let>Pattern=(abcdefghijklmnop|bcdefghijklmnopq|cdefghijklmnopqr|defghijklmnopqrs|efghijklmnopqrst|fghijklmnopqrstu|ghijklmnopqrstuv|hijklmnopqrstuvw|ijklmnopqrstuvwx|jklmnopqrstuvwxy|klmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters16,0
Sub>nTotalScore,%nSequentialLetters16%
Add>nTotalSequentialLetters,%nSequentialLetters16%

//Check for 17 Sequential Letters
Let>Pattern=(abcdefghijklmnopq|bcdefghijklmnopqr|cdefghijklmnopqrs|defghijklmnopqrst|efghijklmnopqrstu|fghijklmnopqrstuv|ghijklmnopqrstuvw|hijklmnopqrstuvwx|ijklmnopqrstuvwxy|jklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters17,0
Sub>nTotalScore,%nSequentialLetters17%
Add>nTotalSequentialLetters,%nSequentialLetters17%

//Check for 18 Sequential Letters
Let>Pattern=(abcdefghijklmnopqr|bcdefghijklmnopqrs|cdefghijklmnopqrst|defghijklmnopqrstu|efghijklmnopqrstuv|fghijklmnopqrstuvw|ghijklmnopqrstuvwx|hijklmnopqrstuvwxy|ijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters18,0
Sub>nTotalScore,%nSequentialLetters18%
Add>nTotalSequentialLetters,%nSequentialLetters18%

//Check for 19 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrs|bcdefghijklmnopqrst|cdefghijklmnopqrstu|defghijklmnopqrstuv|efghijklmnopqrstuvw|fghijklmnopqrstuvwx|ghijklmnopqrstuvwxy|hijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters19,0
Sub>nTotalScore,%nSequentialLetters19%
Add>nTotalSequentialLetters,%nSequentialLetters19%

//Check for 20 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrst|bcdefghijklmnopqrstu|cdefghijklmnopqrstuv|defghijklmnopqrstuvw|efghijklmnopqrstuvwx|fghijklmnopqrstuvwxy|ghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters20,0
Sub>nTotalScore,%nSequentialLetters20%
Add>nTotalSequentialLetters,%nSequentialLetters20%

//Check for 21 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstu|bcdefghijklmnopqrstuv|cdefghijklmnopqrstuvw|defghijklmnopqrstuvwx|efghijklmnopqrstuvwxy|fghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters21,0
Sub>nTotalScore,%nSequentialLetters21%
Add>nTotalSequentialLetters,%nSequentialLetters21%

//Check for 22 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstuv|bcdefghijklmnopqrstuvw|cdefghijklmnopqrstuvwx|defghijklmnopqrstuvwxy|efghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters22,0
Sub>nTotalScore,%nSequentialLetters22%
Add>nTotalSequentialLetters,%nSequentialLetters22%

//Check for 23 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstuvw|bcdefghijklmnopqrstuvwx|cdefghijklmnopqrstuvwxy|defghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters23,0
Sub>nTotalScore,%nSequentialLetters23%
Add>nTotalSequentialLetters,%nSequentialLetters23%

//Check for 24 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstuvwx|bcdefghijklmnopqrstuvwxy|cdefghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters24,0
Sub>nTotalScore,%nSequentialLetters24%
Add>nTotalSequentialLetters,%nSequentialLetters24%

//Check for 25 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstuvwxy|bcdefghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters25,0
Sub>nTotalScore,%nSequentialLetters25%
Add>nTotalSequentialLetters,%nSequentialLetters25%

//Check for 26 Sequential Letters
Let>Pattern=(abcdefghijklmnopqrstuvwxyz)
RegEx>Pattern,PassString,0,matches,nSequentialLetters26,0
Sub>nTotalScore,%nSequentialLetters26%
Add>nTotalSequentialLetters,%nSequentialLetters26%


//Check if numbers only 
IF>{(%nTotalNumeric%>0)AND(%nTotalUpper%=0)AND(%nTotalLower%=0)AND(%nTotalSpecial%=0)}
Let>nNumbersOnly=%nPassScoreLength%
Sub>nTotalScore,%nPassScoreLength%
ENDIF

//Check if letters only
Let>nTotalLetters=%nTotalUpper%+%nTotalLower%
IF>{(%nTotalNumeric%=0)AND(%nTotalLetters%>0)AND(%nTotalSpecial%=0)}
Let>nLettersOnly=%nPassScoreLength%
Sub>nTotalScore,%nPassScoreLength%
ENDIF

//Check Minimum Requirements
IF>{(%nPassScoreLength%>7)AND(%nTotalNumeric%>0)AND(%nTotalUpper%>0)AND(%nTotalLower%>0)AND(%nTotalSpecial%>0)}
Add>nTotalScore,10
LET>nMinRequirements=10

//Apply Bonuses
IF>{(%nUpperOnly%=0)AND(%nLowerOnly%=0)}
Add>nTotalScore,10
ENDIF
IF>{(%nRepeatedNumLetters%=0)}
Add>nTotalScore,10
ENDIF
IF>{(%nRepeatUpper%=0)AND(%nRepeatLower%=0)}
Add>nTotalScore,10
ENDIF
IF>{(%nLettersOnly%=0)AND(%nNumbersOnly%=0)}
Add>nTotalScore,10
ENDIF
IF>{(%nTotalSequentialLetters%=0)AND(%nTotalSequentialNumbers%=0)}
Add>nTotalScore,10
ENDIF

ELSE
Sub>nTotalScore,25
LET>nMinRequirements=0
ENDIF




IF>{(%nTotalSpecial%<3)AND(%nTotalSpecial%>0)}
Let>nTotalScore={(%nTotalScore%+%nTotalSpecial%)*2}
ENDIF
IF>{(%nTotalSpecial%>2)}
Let>nTotalScore={(%nTotalScore%+%nTotalSpecial%)*4}
ENDIF

IF>{(%nTotalScore%>0)AND(%nTotalScore%<21)}
Let>PassDisplayStrength=Very Weak
ENDIF
IF>{(%nTotalScore%>19)AND(%nTotalScore%<41)}
Let>PassDisplayStrength=Weak
ENDIF
IF>{(%nTotalScore%>39)AND(%nTotalScore%<61)}
Let>PassDisplayStrength=Good
ENDIF
IF>{(%nTotalScore%>59)AND(%nTotalScore%<81)}
Let>PassDisplayStrength=Strong
ENDIF
IF>{(%nTotalScore%>78)}
Let>PassDisplayStrength=Very Strong
ENDIF
IF>{(%nTotalScore%<1)}
Let>PassDisplayStrength=Too Short
ENDIF



SetDialogProperty>Dialog1,ProgressBar1,Position,%nTotalScore%
SetDialogProperty>Dialog1,Label2,Caption,%PassDisplayStrength% 

SetDialogProperty>Dialog1,Label1,Caption,Password Strength: %nTotalScore%%CRLF%%CRLF%Password Score Additions%CRLF%Number of Chracters: %nPassScoreLength%%CRLF%Uppercase Letters: %nTotalUpper%%CRLF%Lowercase Letters: %nTotalLower%%CRLF%Numbers: %nTotalNumeric%%CRLF%Symbols: %nTotalSpecial%%CRLF%Requirements: %nMinRequirements%%CRLF%%CRLF%Password Score Deductions%CRLF%Letters Only: %nLettersOnly%%CRLF%Numbers Only: %nNumbersOnly%%CRLF%Repeat Characters (Case Insensitive): %nTotalRepeatCharacter%%CRLF%Uppercase Only: %nUpperOnly%%CRLF%Lowercase Only: %nLowerOnly%%CRLF%Consecutive Uppercase Letters: %nRepeatUpper%%CRLF%Consecutive Lowercase Letters: %nRepeatLower%%CRLF%Consecutive Numbers: %nRepeatNumeric%%CRLF%Sequential Numbers (3+): %nTotalSequentialNumbers%%CRLF%Sequential Letters (3+): %nTotalSequentialLetters%%CRLF%Repeated Numbers And Letters: %nRepeatedNumLetters%%CRLF%E.g. AA%comma% aa%comma% 11%comma% 22 (Case Sensitive)

END>GetPassStrength

Last edited by Rain on Fri Aug 02, 2013 2:45 pm, edited 4 times in total.

Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

Post by Dick99999 » Mon Jul 29, 2013 7:40 am

It seems like an elaborate script that searches for weak patterns in a password. It may not find anything in randomly generated strings and thus give them a high rating.

A bit of an off-topic: there may not be an official password strength standard, but what about time to crack or expected number of combinations to try on average? Would be nice to have the latter also. The time to crack then depends on the state of the art in trying all combinations (smart or just in sequence). I believe is now possible to do 1.0 E11 guesses per seconds in 'IT-households' for weak algorithms.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Jul 29, 2013 5:46 pm

Dick99999 wrote:It seems like an elaborate script that searches for weak patterns in a password. It may not find anything in randomly generated strings and thus give them a high rating.

A bit of an off-topic: there may not be an official password strength standard, but what about time to crack or expected number of combinations to try on average? Would be nice to have the latter also. The time to crack then depends on the state of the art in trying all combinations (smart or just in sequence). I believe is now possible to do 1.0 E11 guesses per seconds in 'IT-households' for weak algorithms.
Time to crack is extremely unreliable for real-world scenarios. This script is neither perfect nor foolproof, and should only be utilized as a loose guide in determining methods for improving the password creation process.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Jul 31, 2013 1:25 am

Need to enable wrapping for the memo box (this was on MS v14).

Image

Apparently my password was very week, however I know for a fact that its quite strong (its actually encrypted).
FIREFIGHTER

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed Jul 31, 2013 3:15 pm

CyberCitizen wrote:Need to enable wrapping for the memo box (this was on MS v14).
Word wrap is set to True by default in v13. I've added "SetDialogProperty>Dialog1,MSMemo1,WordWrap,True" above "Show>Dialog1" to address this issue.
CyberCitizen wrote:Apparently my password was very week, however I know for a fact that its quite strong (its actually encrypted).
The script is not meant to test the strength of encrypted passwords...i.e.
Let>vPassword=1234
Crypt>abc,%vPassword%,cryptval
Base64>cryptval,ENCODE,CryptOutput

Or

Let>vPassword=1234
Crypt>abc,%vPassword%,CryptOutput

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Fri Aug 02, 2013 2:53 am

Sorry I meant that its encrypted when I type it, what the password actually is (how I remember it) is different to what I type. Its also 20 characters long including spaces.

For example (taken this from a box I just saw in the office).

If I was to use it my password would be.

Code: Select all

h;rmr;h dr;g dyptshr
Which = to the below.

Code: Select all

glenelg self storage
Basically by touch typing instead of having my fingers on the two starter keys (F & J) I move them one key to the right. Creates jumbled passwords, so if you have someone watching you type your password or even in a key logger its hard to make sense of the password being used. Eg for a keylogger it still appears encrypted.

This is useful for me in a desktop support enviro where I am entering my admin account details all over the place & when people are watching or near by, just gives that added level of protection.
FIREFIGHTER

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Aug 02, 2013 2:43 pm

I did not include spaces as a special character in my code....because most websites and/or Apps don't allow spaces. I've updated my original post to include spaces.

I want to stress that this script is neither perfect nor foolproof, and should only be utilized as a loose guide in determining methods for improving the password creation process.

Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

Post by Dick99999 » Thu Aug 08, 2013 6:32 pm

Rain wrote: Time to crack is extremely unreliable for real-world scenarios. [..........]
I am in the middle of discussions about this because some sites impose a really low limit on the length of passwords. Do you happen to have some reference about time to crack in real-world scenarios? Thanks in advance.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Thu Aug 08, 2013 9:10 pm

My reference is common sense and the knowledge that there are several methods and tools to crack passwords out there. Google for a tool that will calculate the time to crack a password https://www.google.com/#bav=on.2,or.r_c ... calculator

I have nothing else to add to this subject matter. :wink:

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts