add super simple and naive password input

This commit is contained in:
Akulij 2025-02-26 21:05:38 +05:00
parent a5eef4512f
commit 666fb84a66

View File

@ -17,7 +17,12 @@ type X25519Identity struct {
} }
func main() { func main() {
sum := sha256.Sum256([]byte("some secret password phrase")) var passphrase string
fmt.Print("Enter password: ")
fmt.Scanln(&passphrase)
sum := sha256.Sum256([]byte(passphrase))
fmt.Printf("Password hash: %x\n", sum) fmt.Printf("Password hash: %x\n", sum)
k, err := newX25519IdentityFromScalar(sum[:]) k, err := newX25519IdentityFromScalar(sum[:])