-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web interface and UTF-8 support #2
Conversation
While I admire the effort, I can't merge this. Second, the whole unicode compatibility thing could be brought much simpler, without rewriting crypto code. Something like this would be enough, if you really need it (haven't tested it thoroughly, but pretty sure it would do the trick):
(as this is not the diff, for clarity: 1 line added, 1 line changed). I'm not closing this request only to keep a reminder for myself to add this compatibility code later. |
Thanks for taking the time to look at the pull request. PS: tried your snippet but could not get UTF-8 compatibility after a quick test ... I will take a closer look later though ... |
I did some quick testing using browser, as usual you need to be careful with string vs. unicode, or it will break. As a reference point: Hash generated by https://www.pwdhash.com/ for domain http://www.example.com/ and password "проверка": 0MeobH5tn/ Now, you can call modified code with either unicode string (and get correct result), or utf-8 encoded non-unicode string (and for obvious reasons get wrong result):
|
I see now ... this is the line that encodes using bytes: password = getpass.getpass("Password for %s: " % domain) Indeed, I am getting your exact same output both if testing using the interpreter and launching the program. Once you close the pull request, I will deattach the fork and use pwdhash as a dependency in my code. |
I created #3 to not forget fix this, but don't have time to do that just now. |
Hi! I've added a local web interface using CherryPy and reimplemented the pwdhash algorithm to support UTF-8 master passwords exactly as the Javascript implementation.