# balramrexwal/whatsapp-crypt14-decrypter architecture

> Architecture diagram of the GitHub repository balramrexwal/whatsapp-crypt14-decrypter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/balramrexwal/whatsapp-crypt14-decrypter
- Repository: https://github.com/balramrexwal/whatsapp-crypt14-decrypter

## Overview

WhatsApp Crypt Tools is a command-line decrypter for crypt12, crypt14, and crypt15 backups, given a key file or 64-character key. Its main workflow loads the key, interprets the encrypted backup header using protobuf parsing and/or offset guessing, decrypts and validates the data, then writes a SQLite database or ZIP output. The README documents both parsing modes and memory/buffer options. The implementation is largely concentrated in one source file; unsampled internals are represented only where README evidence supports the relationship.

Main entry points: [`src/wa_crypt_tools/decrypt14_15.py`](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py) (Decrypt CLI), [`proto/prefix.proto`](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/proto/prefix.proto) (Header schemas), [`utils/hex_string_to_encrypted_backup_key.py`](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/utils/hex_string_to_encrypted_backup_key.py) (Hex key converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_decrypt["Decryption workflow"]
  node_cli["Decrypt CLI<br/>[decrypt14_15.py]"]
  node_keyload["Key loading<br/>[decrypt14_15.py]"]
  node_decryptdata["Decrypt and verify<br/>[decrypt14_15.py]"]
  node_decode["Decompress output<br/>[decrypt14_15.py]"]
  node_artifacts["SQLite or ZIP"]
end

subgraph group_formats["Backup formats"]
  node_header["Header parsing<br/>[decrypt14_15.py]"]
  node_offsets["Offset guessing<br/>[decrypt14_15.py]"]
  node_schemas["Header schemas<br/>[prefix.proto]"]
end

subgraph group_keytools["Key utilities"]
  node_keyconvert["Hex key converter"]
end

node_operator(("Operator"))

node_operator -->|"runs"| node_cli
node_operator -->|"provides key"| node_keyload
node_cli -->|"loads key"| node_keyload
node_cli -->|"parses protobuf"| node_header
node_cli -->|"guesses offsets"| node_offsets
node_header -.->|"uses schema"| node_schemas
node_cli -->|"decrypts backup"| node_decryptdata
node_cli -->|"writes decoded data"| node_decode
node_decode -->|"outputs SQLite or ZIP"| node_artifacts
node_operator -->|"converts hex key"| node_keyconvert

click node_cli "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_keyload "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_header "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_offsets "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_schemas "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/proto/prefix.proto"
click node_decryptdata "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_decode "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py"
click node_keyconvert "https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/utils/hex_string_to_encrypted_backup_key.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_keyload,node_decryptdata,node_decode,node_artifacts toneBlue
class node_header,node_offsets,node_schemas toneAmber
class node_keyconvert toneMint
class node_operator toneIndigo
```

## Components

### Decryption workflow

- [Decrypt CLI](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- [Key loading](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- [Decrypt and verify](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- [Decompress output](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- **SQLite or ZIP**

### Backup formats

- [Header parsing](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- [Offset guessing](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/src/wa_crypt_tools/decrypt14_15.py): `src/wa_crypt_tools/decrypt14_15.py`
- [Header schemas](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/proto/prefix.proto): `proto/prefix.proto`

### Key utilities

- [Hex key converter](https://github.com/balramrexwal/whatsapp-crypt14-decrypter/blob/master/utils/hex_string_to_encrypted_backup_key.py): `utils/hex_string_to_encrypted_backup_key.py`

### Other components

- **Operator**

## Connections

- Operator → Decrypt CLI: runs (evidence: `README.md`)
- Operator → Key loading: provides key (evidence: `README.md`)
- Decrypt CLI → Key loading: loads key (evidence: `src/wa_crypt_tools/decrypt14_15.py`)
- Decrypt CLI → Header parsing: parses protobuf (evidence: `README.md`)
- Decrypt CLI → Offset guessing: guesses offsets (evidence: `README.md`)
- Header parsing → Header schemas: uses schema
- Decrypt CLI → Decrypt and verify: decrypts backup (evidence: `README.md`)
- Decrypt CLI → Decompress output: writes decoded data (evidence: `src/wa_crypt_tools/decrypt14_15.py`)
- Decompress output → SQLite or ZIP: outputs SQLite or ZIP (evidence: `README.md`)
- Operator → Hex key converter: converts hex key (evidence: `utils/hex_string_to_encrypted_backup_key.py`)
