LogoAIAny
Icon for item

WeChat 4.x Database Decryptor

Extracts derived keys from running WeChat 4.x processes to decrypt SQLCipher 4 databases and .dat media files, and provides a real-time message monitor with a Web UI. Cross-platform (Windows/Linux/macOS) but requires process-memory or local-data access and is intended for decrypting your own WeChat data only.

Introduction

Most modern WeChat 4.x installs encrypt message databases and media with SQLCipher 4 and ephemeral keys, making local forensic access or backup recovery difficult without the running process. The core insight behind this project is practical: the derived raw DB keys and image keys are present in process memory (or derivable from local kv caches on macOS) for a short time, and automating their extraction lets you decrypt databases and render messages in near real time.

What Sets It Apart
  • Key extraction automation: cross-platform scanners (Windows/Linux memory scanning, macOS Mach/C tool and macOS-specific kv-derivation) that identify the SQLCipher 4 key format used by WeChat and validate keys via HMAC checks on page 1. This removes manual key-hunting and brittle heuristics.
  • Full DB + media support: decrypts SQLCipher 4 databases (AES-256-CBC + HMAC-SHA512, PBKDF2-HMAC-SHA512) and handles WeChat image/video .dat variants (old XOR, V1, V2 AES-ECB+XOR) with deduced/monitored image keys so media previews work inline.
  • Real-time monitoring & low-latency UI: a local Web UI and SSE stream provide live message updates (~100ms total latency in typical setups) and media inline previewing, plus a CLI mode for batch decryption or forensic export.
  • AI integration and transcription options: an optional MCP server stub lets LLM tooling (e.g., Claude Code MCP) query decrypted message data; voice transcription supports local Whisper, whisper.cpp, or OpenAI (configurable—note OpenAI uploads audio off-device).
  • Practical platform trade-offs handled: macOS needs ad-hoc signing or elevated privileges for memory access; Linux/Windows require root/administrator or appropriate ptrace/CAP_SYS_PTRACE capability.
Who It's For & Trade-offs

Great fit if you need to recover or inspect your own WeChat local data (messages, media, contacts) across platforms, build local search/archival exports, or integrate decrypted message data into downstream tooling (including optional AI workflows). It is also useful for researchers and incident responders who can obtain lawful access to the target machine.

Look elsewhere if you need a turnkey cloud backup service or a privacy-preserving multi-user server: this tool requires high privileges (process memory or local filesystem access), may require code-signing on macOS, and—when using OpenAI transcription—uploads audio off-device. Legal and ethical constraints are primary: use only on accounts/data you own or are authorized to inspect.

Implementation notes and practical implications

The repository documents cryptographic details (SQLCipher 4 parameters, page size/reserve, HMAC verification) and shows how image V2 keys are discovered and validated. Its architecture favors reliability over stealth: concurrent WAL handling, per-key locks to avoid file corruption, WAL patching and validation, and conservative fallbacks for transcription backends. If you plan to integrate decrypted data with LLMs, consider local transcription and on-device models to keep sensitive content off third-party servers.

Information

  • Websitegithub.com
  • Authorsylytdeng
  • Published date2026/02/28

Categories