summaryrefslogtreecommitdiffstats
path: root/cmd/hashpw
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-09-23 22:33:30 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-09-23 22:33:30 -0700
commit40ad220fd0e26e3bf3be93c536b25cde1c00490f (patch)
tree1752e13e3bf0d93a5b25a71743eb4d2ce851263b /cmd/hashpw
parentUse HMAC instead of ed25519 (diff)
downloadroseh.moe-40ad220fd0e26e3bf3be93c536b25cde1c00490f.tar.zst
Combine password hash and salt secrets
Diffstat (limited to 'cmd/hashpw')
-rw-r--r--cmd/hashpw/hashpw.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/hashpw/hashpw.go b/cmd/hashpw/hashpw.go
index 6a84fc5..5bc740d 100644
--- a/cmd/hashpw/hashpw.go
+++ b/cmd/hashpw/hashpw.go
@@ -16,13 +16,13 @@ func run() error {
if err != nil {
return err
}
- salt := make([]byte, 32)
+ salt := make([]byte, pwhash.SaltLen)
rand.Read(salt)
_, hashedPassword, err := pwhash.Hash(string(password), salt)
if err != nil {
return err
}
- fmt.Printf("notepad-password=%x\nsalt=%x\n", hashedPassword, salt)
+ fmt.Printf("notepad-password=%x%x\n", salt, hashedPassword)
return nil
}