MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / DeriveKeyFromPassword

Function DeriveKeyFromPassword

cryption/authcrypt.go:174–178  ·  view source on GitHub ↗

DeriveKeyFromPassword generates an encryption key from a password using Argon2 and a provided salt

(password string, salt string)

Source from the content-addressed store, hash-verified

172
173// DeriveKeyFromPassword generates an encryption key from a password using Argon2 and a provided salt
174func DeriveKeyFromPassword(password string, salt string) string {
175 saltBytes, _ := base64.StdEncoding.DecodeString(salt)
176 key := argon2.IDKey([]byte(password), saltBytes, 1, 64*1024, 4, 32)
177 return base64.StdEncoding.EncodeToString(key)
178}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected