From 0d640e791493de79b43b050a13b1cf9c081854ec Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 21 Nov 2025 18:44:58 -0800 Subject: Simplify the password hash and get rid of pbkdf2 Since the password already has 16 bytes of security, pbkdf2 isn't necessary here. We can use a simple sha256. I promise to pick a secure password. --- internal/pwhash/pwhash.go | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 internal/pwhash/pwhash.go (limited to 'internal/pwhash/pwhash.go') diff --git a/internal/pwhash/pwhash.go b/internal/pwhash/pwhash.go deleted file mode 100644 index 576d052..0000000 --- a/internal/pwhash/pwhash.go +++ /dev/null @@ -1,18 +0,0 @@ -package pwhash - -import ( - "crypto/pbkdf2" - "crypto/sha512" -) - -const SaltSize = 8 - -const defaultIter = 12059332 // from tools/finditer - -func HashIter(password string, salt []byte, iter int) ([]byte, error) { - return pbkdf2.Key(sha512.New, password, salt, iter, 32) -} - -func Hash(password string, salt []byte) ([]byte, error) { - return HashIter(password, salt, defaultIter) -} -- cgit v1.3.1