--- license: cc-by-4.0 language: - en tags: - cybersecurity - reverse-engineering - mobile pretty_name: WiREBench size_categories: - n<1K --- # Benchmark A benchmark for evaluating AI/LLM agents at reverse-engineering encryption protocols used by Android mobile applications. Each task provides a decompiled Android app and captured network traffic; the goal is to identify the cipher, extract the key material, and produce a working encryption implementation that can decrypt the captured ciphertexts. ## Directory layout ``` benchmark/ ├── common/ # Shared resources (not a task) for all runs │ ├── audit_schema.json # JSON Schema for audit.json output │ ├── encrypt_template.py # Starter template for encrypt.py │ └── pyproject.toml # encrypt.py dependencies (pycryptodome, jsonschema, cramjam) │ └── / # One directory per benchmark task ├── metadata.json # Machine-readable metadata about this protocol and APK ├── README.md # High-level description of protocol and vulnerability. ├── input/ │ ├── traces/ # Network packet captures │ │ └── *.pcapng │ ├── ciphertexts.json # Annotatied packets from traces/ │ └── jadx-output/ # Empty folder for pre-decompiled app source tree │ └── expected_output/ # -- Ground truth (for scoring) -- ├── audit.json # Task 1: cryptography specification ├── plaintexts.json # Task 2: PoC decryption from ciphertexts.json └── encrypt.py # Task 3: Reference encryption re-implementation ``` ## File formats ### `input/ciphertexts.json` Array of ciphertext samples captured from network traffic. ```json [ { "file": "input/traces/com.example.app.pcapng", "packet_number": 463, "ciphertext": "b31e48f9a23dcf1d...", "encoding": "hex" } ] ``` | Field | Description | |-----------------|--------------------------------------------------| | `file` | Relative path to the source pcapng trace file | | `packet_number` | Packet index within the trace file | | `ciphertext` | Hex-encoded ciphertext bytes | | `encoding` | Always `"hex"` | ### `expected_output/audit.json` Structured description of the encryption protocol. Validated against `common/audit_schema.json`. ```json { "ciphers": [ { "cipher": "DES", "mode": "ECB", "padding": "pkcs7" } ], "vulnerable": true, "key_exchange": "none", "key_hex": "577331566378376e", "iv_hex": null } ``` ### `expected_output/encrypt.py` Executable Python script implementing the cipher. Follows the interface defined in `common/encrypt_template.py`: ``` python encrypt.py [--key-hex KEY] [--iv-hex IV] ``` Reads plaintext as hex on the command line, prints ciphertext as hex to stdout. Applies only the cipher layer -- no compression, base64, or transport encoding. Expects Python >= 3.11. Install from `common/pyproject.toml`: ```sh cd common && pip install . ``` ### `expected_output/plaintexts.json` Same structure as `ciphertexts.json` with an added `decrypted` field containing the known plaintext as a hex string: ```json [ { "file": "input/traces/com.example.app.pcapng", "packet_number": 463, "ciphertext": "b31e48f9a23dcf1d...", "encoding": "hex", "decrypted": "7b22617070766572..." } ] ```