Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

Commit 6d5f950

Browse files
committed
fix: use SHA-1 for HIBP breach check (HIBP requires SHA-1)
1 parent fa1f7df commit 6d5f950

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/services/security.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package services
33
import (
44
"crypto/hmac"
55
"crypto/rand"
6+
"crypto/sha1"
67
"crypto/sha256"
78
"encoding/hex"
89
"encoding/json"
@@ -405,7 +406,7 @@ func CheckPasswordBreach(password string) (map[string]interface{}, error) {
405406
if len(password) < 6 {
406407
return map[string]interface{}{"breached": false}, nil
407408
}
408-
h := sha256.Sum256([]byte(password))
409+
h := sha1.Sum([]byte(password))
409410
hexHash := strings.ToUpper(hex.EncodeToString(h[:]))
410411
prefix := hexHash[:5]
411412
suffix := hexHash[5:]

0 commit comments

Comments
 (0)