If there are 382 words that start with 'a', then the entropy of the acrostic 'aaaaa' should be ln_2(382)*5. However, this is not what xkcdpass reports:
$ xkcdpass -V --acrostic 'a'
With the current options, your word list contains 382 words.
A 1 word password from this list will have roughly 8 (8.58 * 1) bits of entropy,
assuming truly random word selection.
anyone
$ xkcdpass -V --acrostic 'aaaaa'
With the current options, your word list contains 1910 words.
A 5 word password from this list will have roughly 54 (10.90 * 5) bits of entropy,
assuming truly random word selection.
amiable activism arise aspire ageless
(The correct answer would be 8.58 * 5 in the second example)
I believe the problem is here:
|
if options.acrostic: |
|
worddict = wordlist_to_worddict(wordlist) |
|
numwords = len(options.acrostic) |
|
length = 0 |
|
for char in options.acrostic: |
|
length += len(worddict.get(char, [])) |
Currently, it computes the entropy as num_words * ln_2(sum of lengths of word lists for each letter in the acrostic).
The correct formula for the entropy is ln_2(# of words for letter 1) + ln_2(#of words for letter 2) + .... Separating length and num_words doesn't make sense in this setting.
If there are 382 words that start with 'a', then the entropy of the acrostic 'aaaaa' should be
ln_2(382)*5. However, this is not whatxkcdpassreports:(The correct answer would be 8.58 * 5 in the second example)
I believe the problem is here:
XKCD-password-generator/xkcdpass/xkcd_password.py
Lines 163 to 168 in 33c27be
Currently, it computes the entropy as
num_words * ln_2(sum of lengths of word lists for each letter in the acrostic).The correct formula for the entropy is
ln_2(# of words for letter 1) + ln_2(#of words for letter 2) + .... Separatinglengthandnum_wordsdoesn't make sense in this setting.