From e3f71dedf3fcbd9e9112880f4b2a442cabd9fba6 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Tue, 23 Sep 2025 21:49:08 -0700 Subject: Encrypt notepad at rest --- internal/pwhash/pwhash.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/pwhash') diff --git a/internal/pwhash/pwhash.go b/internal/pwhash/pwhash.go index a17ed2e..7bc62d4 100644 --- a/internal/pwhash/pwhash.go +++ b/internal/pwhash/pwhash.go @@ -12,11 +12,11 @@ func HashIter(password string, salt []byte, iter int) ([]byte, error) { return pbkdf2.Key(sha256.New, password, salt, iter, 32) } -func Hash(password string, salt []byte) ([]byte, error) { +func Hash(password string, salt []byte) (key, pwhash []byte, err error) { hashed, err := HashIter(password, salt, defaultIterations) if err != nil { - return nil, err + return nil, nil, err } sha := sha512.Sum512(hashed) - return sha[:], nil + return hashed, sha[:], nil } -- cgit v1.3.1