From 240e6e995745185c34249f1939d4c0d469a6746e Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Thu, 25 Sep 2025 21:53:40 -0700 Subject: Move complex crypto logic into a helper package --- tools/hashpw/hashpw.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tools/hashpw/hashpw.go') diff --git a/tools/hashpw/hashpw.go b/tools/hashpw/hashpw.go index 5bc740d..7705b31 100644 --- a/tools/hashpw/hashpw.go +++ b/tools/hashpw/hashpw.go @@ -1,11 +1,10 @@ package main import ( - "crypto/rand" "fmt" "os" - "gitlab.com/rhogenson/roseh.moe/internal/pwhash" + "gitlab.com/rhogenson/roseh.moe/internal/cryptoutil" "golang.org/x/term" ) @@ -16,13 +15,11 @@ func run() error { if err != nil { return err } - salt := make([]byte, pwhash.SaltLen) - rand.Read(salt) - _, hashedPassword, err := pwhash.Hash(string(password), salt) + hashedPassword, err := cryptoutil.Hash(string(password)) if err != nil { return err } - fmt.Printf("notepad-password=%x%x\n", salt, hashedPassword) + fmt.Printf("notepad-password=%s\n", hashedPassword) return nil } -- cgit v1.3.1