Improve README.md

This commit is contained in:
fluepke 2020-12-04 19:09:03 +01:00
parent 22ea340e27
commit f94d82b91d
No known key found for this signature in database
GPG key ID: 37E30BD2FBE7746A

View file

@ -86,4 +86,16 @@ function whatTheFuck(param1, param2) {
} }
``` ```
From here, I started the GoLang implementation. From here, I started the GoLang implementation, which looks as follows:
```golang
// GetLoginPassword derives the password using the given salts
func GetLoginPassword(password, salt, saltWebUI string) string {
return DoPbkdf2NotCoded(DoPbkdf2NotCoded(password, salt), saltWebUI)
}
// Equivalent to the JS doPbkdf2NotCoded (see README.md)
func DoPbkdf2NotCoded(key, salt string) string {
temp := pbkdf2.Key([]byte(key), []byte(salt), 0x3e8, 0x80, sha256.New)
return hex.EncodeToString(temp[:16])
}
```