From 666fb84a6634c9fc3598f5db3c71e0e512166d3b Mon Sep 17 00:00:00 2001 From: Akulij Date: Wed, 26 Feb 2025 21:05:38 +0500 Subject: [PATCH] add super simple and naive password input --- cmd/age-gen-passphrase/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/age-gen-passphrase/main.go b/cmd/age-gen-passphrase/main.go index 87f25f8..e4eaebf 100644 --- a/cmd/age-gen-passphrase/main.go +++ b/cmd/age-gen-passphrase/main.go @@ -17,7 +17,12 @@ type X25519Identity struct { } 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) k, err := newX25519IdentityFromScalar(sum[:])