Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-10-22 14:47:17 +07:00
co-authored by Claude Opus 5.5
commit 3639d2184a
574 changed files with 61690 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package crypt
import (
"testing"
"videoweb/pub/common/log"
)
var (
PlatPublicKey = `
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCWtWnWmTgLemO+GBMWIX9N5yx2
YMc+4MczBogNdTFjF4rrd/+Y1G9qJ8ZDHR7qjBQgJjzcZrGYRUf2wiY6T9ble9+h
s14pYPpXqkSoD2VOQI4+idb6nRgVQ6rXyMQps7ORcshmEtIS/Ra3aG3XaAFAUCfO
E3nHGyldtNIGvuBTAQIDAQAB
-----END PUBLIC KEY-----`
)
func TestRSA(t *testing.T) {
//data := make([]byte, 0)
testData := "是对的发送打赏打赏打赏打赏的"
rawContext, err := RSAEncryptByPublicKey(PlatPublicKey, []byte(testData))
if err != nil {
log.Error("wnth RSAEncryptByPublicKey err", log.Any("err", err))
return
}
log.Info(string(rawContext))
}