summaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-11-21 18:44:58 -0800
committerRose Hogenson <rosehogenson@posteo.net>2025-11-21 18:44:58 -0800
commit0d640e791493de79b43b050a13b1cf9c081854ec (patch)
treee545cc0db40612260c8a1995d38f6bb600a87c2f /internal
parent4be64dd369b4bbdf3c4c0972c949c6e150377699 (diff)
downloadroseh.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')
-rw-r--r--internal/pwhash/pwhash.go18
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)
-}