feat: add tool rsa

This commit is contained in:
zhaoyupeng
2025-07-17 16:17:36 +08:00
parent 104745e260
commit 2172a39a20
5 changed files with 375 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import (
func TestAes(t *testing.T) {
key := os.Getenv("AES_KEY")
name := "admin"
name := "YizhiSEC@123"
res, err := AesEncrypt([]byte(name), []byte(key))
if err != nil {
t.Fatal(err)
@ -23,3 +23,14 @@ func TestAes(t *testing.T) {
t.Logf("raw = %s", string(raw))
}
func TestDecrypt(t *testing.T) {
key := os.Getenv("AES_KEY")
enc := "2hurNK+0+b9lEO2hNAkc+TzVx7KH7S0/mRt7mWBJiFA="
raw, err := AesDecrypt(enc, []byte(key))
if err != nil {
t.Fatal(err)
}
t.Logf("raw = %s", string(raw))
}