Files
go-afero-encfs/main.go
2024-08-31 15:12:24 +08:00

36 lines
614 B
Go

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))
}