Skip to content

Commit

Permalink
refine prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Aug 14, 2024
1 parent 9b50d05 commit 643f047
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions cmd/hppktool/cmd/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
var encryptCmd = &cobra.Command{
Use: "encrypt",
Short: "encrypts a message from standard input",
Long: `the message will first be SHA256 hashed and then encrypted using HPPK, unless -raw is specified`,
Long: `Encrypt a message with HPPK from standard input.
The message is first SHA256 hashed, unless -raw is specified`,
Run: func(cmd *cobra.Command, args []string) {
silent, err := cmd.Flags().GetBool("silent")
if err != nil {
Expand Down Expand Up @@ -115,6 +116,6 @@ func init() {
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// encryptCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
encryptCmd.Flags().StringP("pubkey", "p", "./id_hppk.pub", "the hppk public key file")
encryptCmd.Flags().StringP("pubkey", "p", "./id_hppk.pub", "the HPPK public key file")
encryptCmd.Flags().Bool("raw", false, "encrypt the raw message, the message length must not exceed 256 bytes")
}
1 change: 1 addition & 0 deletions cmd/hppktool/cmd/keygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
var keygenCmd = &cobra.Command{
Use: "keygen [directory]",
Short: "generate a hppk private/public key pair",
Long: "Generate a HPPK private/public key pair with given order and save them to the specified directory.",
Example: "hppktool keygen /tmp\n" + "hppktool keygen /tmp --order 5",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/hppktool/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
var rootCmd = &cobra.Command{
Use: "hppktool",
Short: "HPPK key management tool",
Long: `Key generation, signing, verification, and secret encryption tool for HPPK.`,
Long: `HPPK key management tool.
HPPK key generation, signing, verification, and secret encryption.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand Down
3 changes: 2 additions & 1 deletion cmd/hppktool/cmd/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
var signCmd = &cobra.Command{
Use: "sign",
Short: "sign a message from standard input",
Long: `the message will first be SHA256 hashed and then encrypted using HPPK, unless -raw is specified`,
Long: `Sign a message with HPPK from standard input with a given public key.
The message is first SHA256 hashed, unless -raw is specified`,
Run: func(cmd *cobra.Command, args []string) {
silent, err := cmd.Flags().GetBool("silent")
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions cmd/hppktool/cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (
var verifyCmd = &cobra.Command{
Use: "verify",
Short: "verify a message from standard input",
Long: `the message will first be SHA256 hashed and then be verified against using HPPK,unless -raw is specified`,
Long: `Verify a HPPK signed message from standard input against the signature file and public key.
The message is first SHA256 hashed, unless -raw is specified`,
Run: func(cmd *cobra.Command, args []string) {
silent, err := cmd.Flags().GetBool("silent")
if err != nil {
Expand Down Expand Up @@ -128,7 +129,7 @@ func init() {
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// verifyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
verifyCmd.Flags().StringP("pubkey", "p", "./id_hppk.pub", "the hppk public key file")
verifyCmd.Flags().String("sigfile", "./sigfile", "the signed signature file")
verifyCmd.Flags().Bool("raw", false, "encrypt the raw message, the message length must not exceed 256 bytes")
verifyCmd.Flags().StringP("pubkey", "p", "./id_hppk.pub", "the HPPK public key file to verify against.")
verifyCmd.Flags().String("sigfile", "./sigfile", "the signed signature file.")
verifyCmd.Flags().Bool("raw", false, "encrypt the raw message, the message length must not exceed 256 bytes.")
}

0 comments on commit 643f047

Please sign in to comment.