PHPackages                             tourze/wechat-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/wechat-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tourze/wechat-helper
====================

微信消息加密解密和XML处理助手工具包

0.0.2(1y ago)03.8k4MITPHPPHP ^8.1CI passing

Since May 1Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/wechat-helper)[ Packagist](https://packagist.org/packages/tourze/wechat-helper)[ RSS](/packages/tourze-wechat-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (4)

WechatHelper
============

[](#wechathelper)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/1e93a56a26001cf1f94389f2da699427d17cb20b78fec9f7c76347bb11da335a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f7765636861742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-helper)[![PHP Version Require](https://camo.githubusercontent.com/475b69db4fd3aa7ad4295b5a61d9073e3af8a249fb94695157599a5c32a09dda/687474703a2f2f706f7365722e707567782e6f72672f746f75727a652f7765636861742d68656c7065722f726571756972652f706870)](https://packagist.org/packages/tourze/wechat-helper)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/d1d33a0a212cdba1fef9bd3297ad712b0639eee24775ac899c82ecb300d055d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f7765636861742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-helper)[![Coverage](https://camo.githubusercontent.com/a2a0c20189e30fb42d29fff8dfa311c7091387d5c6911c6cf8c0a6535e02f7e4/68747470733a2f2f636f6465636f762e696f2f67682f746f75727a652f7068702d6d6f6e6f7265706f2f6272616e63682f6d61737465722f67726170682f62616467652e7376673f666c61673d7765636861742d68656c706572)](https://codecov.io/gh/tourze/php-monorepo?flag=wechat-helper)

A PHP library providing essential helper functions for WeChat development, including AES encryption/decryption and XML processing utilities with comprehensive security validation.

Features
--------

[](#features)

- AES encryption and decryption with 128/192/256-bit key support
- WeChat message encryption/decryption for secure communication
- WeChat Mini Program data decryption support
- XML parsing with sanitization and CDATA handling
- Array to XML conversion with nested structure support
- Comprehensive exception handling for security validation
- Compatible with PHP 8.1+ and modern WeChat APIs

Dependencies
------------

[](#dependencies)

This package requires the following PHP extensions:

- `ext-json` - JSON processing
- `ext-libxml` - XML library functionality
- `ext-openssl` - OpenSSL encryption
- `ext-simplexml` - Simple XML processing

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require tourze/wechat-helper
```

Quick Start
-----------

[](#quick-start)

### AES Encryption

[](#aes-encryption)

```
