wincred
wincred copied to clipboard
Null notation in the credentials blob
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.
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.