MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / simpleDecrypt

Function simpleDecrypt

internal/utils/encrypt.go:75–89  ·  view source on GitHub ↗
(data []byte, key string)

Source from the content-addressed store, hash-verified

73}
74
75func simpleDecrypt(data []byte, key string) []byte {
76 var method = &AES256CFBMethod{}
77 err := method.Init([]byte(key), []byte(key[:16]))
78 if err != nil {
79 logs.Println("[MagicKeyEncode]" + err.Error())
80 return data
81 }
82
83 src, err := method.Decrypt(data)
84 if err != nil {
85 logs.Println("[MagicKeyEncode]" + err.Error())
86 return data
87 }
88 return src
89}
90
91func SimpleEncryptMap(m maps.Map) (base64String string, err error) {
92 mJSON, err := json.Marshal(m)

Callers 1

SimpleDecryptFunction · 0.85

Calls 3

InitMethod · 0.65
DecryptMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected