DeriveKeyFromPassword generates an encryption key from a password using Argon2 and a provided salt
(password string, salt string)
| 172 | |
| 173 | // DeriveKeyFromPassword generates an encryption key from a password using Argon2 and a provided salt |
| 174 | func 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected