feat: init commit

This commit is contained in:
2024-08-31 15:12:24 +08:00
parent 131f10d8ba
commit ed021b554e
7 changed files with 276 additions and 0 deletions

35
main.go Normal file
View File

@@ -0,0 +1,35 @@
package main
import (
"fmt"
"encoding/hex"
"crypto/aes"
"github.com/spf13/afero"
)
func main() {
fmt.Println("Hello Go.")
osFs := afero.NewOsFs()
fmt.Println(osFs)
key := []byte {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
cipher, err := aes.NewCipher(key)
if err != nil {
fmt.Println(err)
return
}
dest := []byte {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
src := []byte {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
cipher.Encrypt(dest, src)
fmt.Println(hex.EncodeToString(key))
fmt.Println(hex.EncodeToString(src))
fmt.Println(hex.EncodeToString(dest))
}