package main
import (
"encoding/hex"
"fmt"
"github.com/gogf/gf/v2/crypto/gaes"
)
func main() {
key := []byte("B4OcDhdFwIyDdjFz") // 16位
res, _ := gaes.Encrypt([]byte("hequan"), key)
res2 := hex.EncodeToString(res)
fmt.Println(res2) // 650d7f2e5aff02da85ff4af9ae36b052
res3, _ := hex.DecodeString(res2)
res4, _ := gaes.Decrypt(res3, key)
fmt.Println(string(res4)) //hequan
}