add encrypt private command

This commit is contained in:
Yuzuki616
2023-07-15 18:13:16 +08:00
parent 15efffba0d
commit 97a420f9f3
3 changed files with 28 additions and 5 deletions

View File

@@ -145,7 +145,7 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
return nil, fmt.Errorf("decode v2ray extra error: %s", err)
}
if node.ExtraConfig.RealityConfig.PrivateKey != "" {
temp := crypt.GenShaHash([]byte(c.APIHost + c.Token))
temp := crypt.GenShaHash([]byte(c.APIHost + c.Token))[:32]
temp, err = crypt.AesDecrypt(node.ExtraConfig.RealityConfig.PrivateKey, []byte(temp))
node.ExtraConfig.RealityConfig.PrivateKey = temp
}