pkg/tools/passwd.go
2023-12-17 13:14:09 +01:00

31 lines
465 B
Go

package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"novit.tech/direktil/pkg/bootstrapconfig"
)
func main() {
in := bufio.NewReader(os.Stdin)
read := func() string {
s, err := in.ReadString('\n')
if err != nil {
log.Fatal(err)
}
return strings.TrimSpace(s)
}
seed := read()
pass := read()
hash := bootstrapconfig.PasswordHashFromSeed([]byte(seed), []byte(pass))
fmt.Println(bootstrapconfig.JoinSeedAndHash([]byte(seed), hash))
}