Files
Archive/xray-core/transport/internet/kcp/cryptreal.go
2025-09-08 20:41:11 +02:00

14 lines
247 B
Go

package kcp
import (
"crypto/cipher"
"crypto/sha256"
"github.com/xtls/xray-core/common/crypto"
)
func NewAEADAESGCMBasedOnSeed(seed string) cipher.AEAD {
hashedSeed := sha256.Sum256([]byte(seed))
return crypto.NewAesGcm(hashedSeed[:16])
}