cmd/balloon/main.go | 11 ++++++++++- diff --git a/cmd/balloon/main.go b/cmd/balloon/main.go index cb51560bf61808356273e016755326d58f82926fc0d13e7023e3048feacf8713..d8d5aeae51040d77fa65f68276449a99eb66f2c085476d61383f823db0c9196c 100644 --- a/cmd/balloon/main.go +++ b/cmd/balloon/main.go @@ -21,6 +21,7 @@ import ( "crypto/rand" "crypto/sha512" + "encoding/base64" "encoding/hex" "flag" "fmt" @@ -52,5 +53,13 @@ } if err != nil { panic(err) } - fmt.Println(hex.EncodeToString(balloon.H(sha512.New, []byte(*passwd), salt, *s, *t, *p))) + fmt.Println("Salt:", hex.EncodeToString(salt)) + h := balloon.H(sha512.New, []byte(*passwd), salt, *s, *t, *p) + fmt.Println("Hash:", hex.EncodeToString(h)) + fmt.Printf( + "Encoded: $balloon$h=sha512,s=%d,t=%d,p=%d$%s$%s\n", + *s, *t, *p, + base64.RawStdEncoding.EncodeToString(salt), + base64.RawStdEncoding.EncodeToString(h), + ) }