加解密,只是sm2,aes,sm4,rsa
Go to file
renzhiyuan 34e1c4b812 first push 2025-02-20 17:51:53 +08:00
encrypt_way first push 2025-02-20 17:49:10 +08:00
random_str first push 2025-02-20 17:49:10 +08:00
README.md first push 2025-02-20 17:51:53 +08:00
aes.go first push 2025-02-20 17:49:10 +08:00
crypt_test.go first push 2025-02-20 17:49:10 +08:00
encrypt.go first push 2025-02-20 17:49:10 +08:00
go.mod first push 2025-02-20 17:49:10 +08:00
rsa.go first push 2025-02-20 17:49:10 +08:00
sm2.go first push 2025-02-20 17:49:10 +08:00
sm4.go first push 2025-02-20 17:49:10 +08:00
types.go first push 2025-02-20 17:49:10 +08:00

README.md

安装

$ go get -u gitea.cdlsxd.cn/self-tools/l_crypt

使用

	text := "YOUR NEEDD ENCRYPT TEXT"
    var appInfo = &AppEncrypt{
        UniKEY: "yourEncryptToken",
    }
    cryptFunc := Crypt(CryptAES) //CryptAESCryptRSACryptSM2CryptSM4
    encryptData, err := cryptFunc(appInfo).Encrypt(text)
    t.Log(string(encryptData), err)
    decryptData, err := cryptFunc(appInfo).Decrypt(string(encryptData))
    t.Log(string(decryptData), err)