Skip to content

Commit

Permalink
List available ciphers and pick a default
Browse files Browse the repository at this point in the history
  • Loading branch information
riobard committed Feb 6, 2017
1 parent 9d0951d commit e604878
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
}

flag.BoolVar(&config.Verbose, "verbose", false, "verbose mode")
flag.StringVar(&flags.Cipher, "cipher", "", "cipher")
flag.StringVar(&flags.Cipher, "cipher", "aes-128-gcm-16", "available ciphers: "+strings.Join(listCipher(), " "))
flag.StringVar(&flags.Key, "key", "", "base64url-encoded key (derive from password if empty)")
flag.IntVar(&flags.Keygen, "keygen", 0, "generate a base64url-encoded random key of given length in byte")
flag.StringVar(&flags.Password, "password", "", "password")
Expand All @@ -68,15 +68,6 @@ func main() {
return
}

if flags.Cipher == "" {
ls := listCipher()
fmt.Fprintf(os.Stderr, "# available ciphers\n")
for _, each := range ls {
fmt.Fprintf(os.Stderr, "%s\n", each)
}
return
}

var key []byte
if flags.Key != "" {
k, err := base64.URLEncoding.DecodeString(flags.Key)
Expand Down

0 comments on commit e604878

Please sign in to comment.