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

Null notation in the credentials blob #50

Open
velhalkaran28 opened this issue Dec 11, 2023 · 1 comment
Open

Null notation in the credentials blob #50

velhalkaran28 opened this issue Dec 11, 2023 · 1 comment

Comments

@velhalkaran28
Copy link

I created a password with value 123456 under generic credential
After printing the blob slice, it had these value [49 0 50 0 51 0 52 0 53 0 54 0]
After each character there is a presence of 0 which is null byte.

@danieljoos
Copy link
Owner

danieljoos commented Dec 15, 2023

Yes, this is caused by Windows using UCS-2 (basically UTF-16 LE).
It's mentioned on the README:
https://github.com/danieljoos/wincred?tab=readme-ov-file#encoding
There is also an example of how to parse this, if you want to use strings.

As this is more or less a decision of the app code that uses this library, I didn't include any string parsing/encoding in wincred.
You can store any []byte data you want in it. In case you want to be compatible with other Windows apps (like the Windows vault that you've probably used to create the mentioned password), you probably want to use UTF16-LE.

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

2 participants