Entropy is a measure of change. Within string-based entropy we measure the change in the characters used.
String entropy |
Outline
With string entropy we measure the amount of change in a string, and which is typically used to measure password strength. The following gives some measures:
111 10 123 10 1111111 23 qwerty1 36 zzhg632 36 abcdefgh 38 password 38 qwerty11 41 k5DfGhqw 48 azazazaz 48 qwerty123 47 hqxwazp19 47 hqxwazp195g2dfa 78 hqxwaz91xp195g2dfa 93 hAqxwaZ91xp195g2dfa 113
The surprising thing here is that "qwerty1" gets the same score as "zzhg632". Many online systems use a measure of entropy for their assessment of the password. Some sample code to gain a score is:
var entropy = require('string-entropy'); mystr="test"; console.log("String:\t\t",mystr); res=entropy(mystr) console.log("Entropy:\t",res); if (res<25) console.log("Poor password"); else if (res<50) console.log("Weak password"); else if (res<75) console.log("Reasonable password"); else if (res<100) console.log("Very good password"); else console.log("Excellent password");