feat(shadowsocks): implement support for SIP022 AEAD-2022 ciphers

This commit is contained in:
Chang lue Tsen
2025-05-31 11:28:06 -04:00
parent 1a21984c27
commit 0fb0aac2fa
10 changed files with 85 additions and 28 deletions
+19
View File
@@ -0,0 +1,19 @@
package proxy
import (
"github.com/perfect-panel/server/pkg/tool"
"github.com/perfect-panel/server/pkg/uuidx"
)
func GenerateShadowsocks2022Password(ss Shadowsocks, password string) (string, string) {
// server key
var serverKey string
if ss.Method == "2022-blake3-aes-128-gcm" {
serverKey = tool.GenerateCipher(ss.ServerKey, 16)
password = uuidx.UUIDToBase64(password, 16)
} else {
serverKey = tool.GenerateCipher(ss.ServerKey, 32)
password = uuidx.UUIDToBase64(password, 32)
}
return serverKey, password
}