Skip to content
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

Kindle for PC fails when username has non-ASCII characters #118

Closed
apprenticeharper opened this issue Aug 4, 2016 · 10 comments
Closed

Kindle for PC fails when username has non-ASCII characters #118

apprenticeharper opened this issue Aug 4, 2016 · 10 comments

Comments

@apprenticeharper
Copy link
Owner

I have had several reports that Kindle for PC fails when a username has an accented character. I have been able to reproduce this error, but I have unable to fix it - no matter what encoding or processing I do with the username I have been unable to find the right way to generate a working key.

I would like help in two ways

(1) Reports from anyone with a username that contains non-ASCII charcaters where Kindle for PC WORKS.
(2) Suggestions from anyone who's traced through the current Kindle for PC on how a non-ASCII username should be processed.

@FlyingDutchman12
Copy link

Probably half-off-topic, moving my profile to a plain-ASCII username worked for me - which might not be an option for everyone ...

@apprenticeharper
Copy link
Owner Author

If anyone has further information, I'd be pleased to hear it. I tried all the combinations of utf-8 and ASCII conversion that I could think of, and nothing seemed to do the trick.

Oh. I can't remember now whether I tried specifically a conversion to the local Windows 8-bit character set for utf-8. I'll give it a go when I can.

@oneofusoneofus
Copy link

The correct way to filter the user name is to replace non-ASCII characters with unichr(0xfffd) and encode in utf8. But since the DSN is stored in the kinf database and the purpose of the user name in K4PC decryption is to calculate the DSN it isn't really needed at all. The hashed user name is also present in the kinf database and is also not needed.

@apprenticeharper
Copy link
Owner Author

Very many thanks indeed!

@apprenticeharper
Copy link
Owner Author

Confirmed that that fixes the problem. I've found the DSN in the kinf database too, but not the hashed username. But I'll tweak the code to the the DSN if present as well.

@oneofusoneofus
Copy link

The hashed user name kinf key is UsernameHash. It was added to the list of known keys in the 6.5.4 Tools release. That combined with SerialNumber (the key for the hashed volume serial number) and MazamaRandomNumber can be used to calculate the DSN if it is not present.

Some other kinf keys that may be present are: kindle.accounttype.info, krx.flashcardsplugin.data.encryption_key, krx.notebookexportplugin.data.encryption_key, proxy.http.password, proxy.http.username

@apprenticeharper
Copy link
Owner Author

Many thanks again.

@apprenticeharper
Copy link
Owner Author

I have just uploaded a new version of the code for the plugin. The new plugin can be downloaded here:

https://github.com/apprenticeharper/DeDRM_tools/tree/master/DeDRM_calibre_plugin

I would appreciate feedback about this new version from anyone who's encountered this problem. Thank you.

@ElleKayEm
Copy link

Looks like issue #311 still had a problem with this.

@apprenticeharper
Copy link
Owner Author

Closing, as I think the problem is now solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants