diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-21 18:44:58 -0800 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-11-21 18:44:58 -0800 |
| commit | 0d640e791493de79b43b050a13b1cf9c081854ec (patch) | |
| tree | e545cc0db40612260c8a1995d38f6bb600a87c2f /internal/pwhash | |
| parent | Use a weird encoding for the time.Time (diff) | |
| download | roseh.moe-0d640e791493de79b43b050a13b1cf9c081854ec.tar.zst | |
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.
Diffstat (limited to 'internal/pwhash')
| -rw-r--r-- | internal/pwhash/pwhash.go | 18 |
1 files changed, 0 insertions, 18 deletions
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) -} |
