fixed conversion error for aes cipher

This commit is contained in:
Derek McQuay 2016-03-14 13:59:24 -07:00
parent e93d87cb89
commit 99c419a090
2 changed files with 7 additions and 2 deletions

View File

@ -122,7 +122,7 @@ func main() {
var vig = &cobra.Command{
Use: "vig",
Short: "vignenere cipher",
Short: "vigenere cipher",
Long: `perform vigenere cipher`,
Run: func(cmd *cobra.Command, args []string) {
if len(args) < 1 || key == "" {

View File

@ -118,7 +118,12 @@ func BlockGen(arg string) []Block {
all := []Block{}
b := Block{}
for i, char := range arg {
value, err := strconv.Atoi(hex.EncodeToString([]byte(string(char))))
value, err := strconv.ParseUint(
hex.EncodeToString(
[]byte(string(char))),
16,
32,
)
if err != nil {
log.Fatal(err)
}