Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Script crashes on password with extended ASCII passwords #3

Closed
Cieper opened this issue Jan 23, 2019 · 3 comments
Closed

Script crashes on password with extended ASCII passwords #3

Cieper opened this issue Jan 23, 2019 · 3 comments

Comments

@Cieper
Copy link

Cieper commented Jan 23, 2019

I generated a password using KeePassXC's password generator, and enabled the "Extended ASCII" option, generating the following password:

`²¢D\=X\NÉZ¯Ú;"IøUü6-}¼#à~A¿»Öcã1s(½:ðâ~rÕnY®Ü[¥Ý!=_4«÷ÜÕ¾ý;(ßcò5]ßÔ"çÛ1áý1Mj9æxRÙ~|kf<%Ô5¼Å5xçkZ/`a\ÛFßÜ¡ÈÞ{ÌG=vD¾ÀÏa´aãÖ6ØÊFLv

When scanning the passwords this causes the program to crash, with either of the following crashes, depending upon the exact password used:

Traceback (most recent call last):
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 51, in <module>
    main()
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 40, in main
    r = check_hash(kv['Password'])
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 22, in check_hash
    h = hashlib.sha1(password).hexdigest().upper()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf7' in position 1: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 51, in <module>
    main()
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 40, in main
    r = check_hash(kv['Password'])
  File "/home/cieper/bin/kdbxpasswordpwned.py", line 22, in check_hash
    h = hashlib.sha1(password).hexdigest().upper()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)
@fopina
Copy link
Owner

fopina commented Jan 24, 2019

could you share a kdbx in that tool with such password and share it so I can include it in the tests? just a single entry so it's small :)

@Cieper
Copy link
Author

Cieper commented Jan 24, 2019

Sure thing, I attached extended-ascii.kdbx.zip. The password required for the file is 'extended-ascii'

fopina added a commit that referenced this issue Jan 27, 2019
@fopina
Copy link
Owner

fopina commented Jan 27, 2019

Should be fixed now (in master and in dev docker tag), thanks for reporting!

@fopina fopina closed this as completed Jan 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants