MCPcopy
hub / github.com/silenceper/wechat / aesKeyDecode

Function aesKeyDecode

util/crypto.go:109–123  ·  view source on GitHub ↗
(encodedAESKey string)

Source from the content-addressed store, hash-verified

107}
108
109func aesKeyDecode(encodedAESKey string) (key []byte, err error) {
110 if len(encodedAESKey) != 43 {
111 err = fmt.Errorf("the length of encodedAESKey must be equal to 43")
112 return
113 }
114 key, err = base64.StdEncoding.DecodeString(encodedAESKey + "=")
115 if err != nil {
116 return
117 }
118 if len(key) != 32 {
119 err = fmt.Errorf("encodingAESKey invalid")
120 return
121 }
122 return
123}
124
125// AESDecryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
126// 参考:github.com/chanxuehong/wechat.v2

Callers 2

EncryptMsgFunction · 0.85
DecryptMsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…