code: func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte) {
  	const (
  		BlockSize = 32            // PKCS#7
  		BlockMask = BlockSize - 1 // BLOCK_SIZE 为 2^n 时, 可以用 mask 获取针对 BLOCK_SIZE 的余数
  	)
  
  	appIDOffset := 20 + len(rawXMLMsg)
  	contentLen := appIDOffset + len(appID)
  	amountToPad := BlockSize - contentLen&BlockMask
  	plaintextLen := contentLen + amountToPad
  
  	plaintext := make([]byte, plaintextLen)
  
  	// 拼接
  	copy(plaintext[:16], random)
  	encodeNetworkByteOrder(plaintext[16:20], uint32(len(rawXMLMsg)))
  	copy(plaintext[20:], rawXMLMsg)
  	copy(plaintext[appIDOffset:], appID)
  
  	// PKCS#7 补位
  	for i := contentLen; i < plaintextLen; i++ {
  		plaintext[i] = byte(amountToPad)
  	}
  
  	// 加密
  	block, err := aes.NewCipher(aesKey[:])
  	if err != nil {
  		panic(err)
  	}
  	mode := cipher.NewCBCEncrypter(block, aesKey[:16])
  	mode.CryptBlocks(plaintext, plaintext)
  
  	ciphertext = plaintext
  	return
  }
docs: //AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
  //参考：github.com/chanxuehong/wechat.v2