MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / SimpleDecrypt

Function SimpleDecrypt

internal/utils/encrypt.go:65–73  ·  view source on GitHub ↗

SimpleDecrypt 解密特殊信息

(data []byte)

Source from the content-addressed store, hash-verified

63
64// SimpleDecrypt 解密特殊信息
65func SimpleDecrypt(data []byte) []byte {
66 if bytes.HasSuffix(data, encryptV2Suffix) {
67 data = data[:len(data)-len(encryptV2Suffix)]
68 return simpleDecrypt(data, defaultClusterEncryptKey)
69 }
70
71 // 兼容老的Key
72 return simpleDecrypt(data, defaultNodeEncryptKey)
73}
74
75func simpleDecrypt(data []byte, key string) []byte {
76 var method = &AES256CFBMethod{}

Callers 5

TestSimpleEncryptFunction · 0.92
DecodeMethod · 0.92
SimpleDecryptMapFunction · 0.85
SimpleDecryptObjetFunction · 0.85

Calls 1

simpleDecryptFunction · 0.85

Tested by 2

TestSimpleEncryptFunction · 0.74