Refactor: Rename NanoKVM to BatchuKVM and update server URL

This commit is contained in:
2025-12-09 20:35:38 +09:00
commit 8cf674c9e5
396 changed files with 54380 additions and 0 deletions

30
server/utils/encrypt.go Normal file
View File

@@ -0,0 +1,30 @@
package utils
import (
"net/url"
"github.com/mervick/aes-everywhere/go/aes256"
log "github.com/sirupsen/logrus"
)
// SecretKey is only used to prevent the data from being transmitted in plaintext.
const SecretKey = "NanoKVM-KOREA-TestKey-2512092155"
func Decrypt(ciphertext string) (string, error) {
if ciphertext == "" {
return "", nil
}
decrypt := aes256.Decrypt(ciphertext, SecretKey)
return decrypt, nil
}
func DecodeDecrypt(data string) (string, error) {
ciphertext, err := url.QueryUnescape(data)
if err != nil {
log.Errorf("decode ciphertext failed: %s", err)
return "", err
}
return Decrypt(ciphertext)
}