快乐与微笑的淘气

关注

go 密码 token passwd 加密解密

快乐与微笑的淘气

关注

阅读 73

2022-06-16

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

}


相关推荐

WikongGuan

Go 加密解密算法小结

WikongGuan 58 0 0

开源分享

openssl passwd 手动生成密码——passwd提权

开源分享 123 0 0

肉肉七七

多表代换密码的加密与解密

肉肉七七 35 0 0

Star英

狗东token解密,content加密算法破解

Star英 89 0 0

驚鴻飛雪

【C++】凯撒密码 实现加密与解密

驚鴻飛雪 68 0 0

ZSACH

linux中普通用户修改密码出现(passwd:Authentication token manipulation error)

ZSACH 43 0 0

德州spark

【用户认证】密码加密,用户状态保存,cookie,session,token

德州spark 76 0 0

waaagh

linux passwd批量修改用户密码

waaagh 15 0 0

捌柒陆壹

前端使用rsa对密码加密,springboot使用rsa对密码进行解密

捌柒陆壹 14 0 0

倪雅各

Go 语言入门很简单:AES加密和解密

倪雅各 92 0 0

精彩评论(0)

0 0 举报