fixed conversion error for aes cipher
This commit is contained in:
parent
e93d87cb89
commit
99c419a090
2
main.go
2
main.go
@ -122,7 +122,7 @@ func main() {
|
|||||||
|
|
||||||
var vig = &cobra.Command{
|
var vig = &cobra.Command{
|
||||||
Use: "vig",
|
Use: "vig",
|
||||||
Short: "vignenere cipher",
|
Short: "vigenere cipher",
|
||||||
Long: `perform vigenere cipher`,
|
Long: `perform vigenere cipher`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(args) < 1 || key == "" {
|
if len(args) < 1 || key == "" {
|
||||||
|
@ -118,7 +118,12 @@ func BlockGen(arg string) []Block {
|
|||||||
all := []Block{}
|
all := []Block{}
|
||||||
b := Block{}
|
b := Block{}
|
||||||
for i, char := range arg {
|
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user