init: web_hgcg_server 初始化提交

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 16:44:55 +08:00
co-authored by Claude Opus 4.7
commit 189556e702
627 changed files with 126228 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))
}