# DES Key Cracker Native desktop app (Node.js + [NodeGui](https://docs.nodegui.org/docs/api/manual/synopsis/)) that recovers the 8-byte DES key for a TechMed / Pectus `.med` scan, using CPU threads plus GPU acceleration: - **macOS:** Apple Metal (`des_brute` kernel) - **Windows:** NVIDIA CUDA when the CUDA Toolkit is installed - **Both:** multi-core CPU fallback Search is short printable keys over a charset, padded to 8 bytes. Machines can cooperate on a LAN. The **master** listens on a WebSocket port and hands each **slave worker** (each exposed CPU or GPU) a block described only by generation parameters (`start`, `count`, `deviceKey`, `keyLen`, `charset`, `padByte`) — not a list of keys. Each worker has its own block size; CPU workers default to 1,048,576 keys and GPU workers to 16,777,216 so the GPU keeps more of the keyspace. ## Requirements - Node.js 18+ (the app runs under **qode**, which NodeGui installs) - CMake and a C++ toolchain (needed to install `@nodegui/nodegui`) - **macOS:** Xcode command-line tools (clang + Metal) - **Windows CPU:** clang++, g++, or MSVC (`cl`) - **Windows CUDA:** [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) (`nvcc`) and an NVIDIA GPU. Without `nvcc` the app still runs on CPU. ## Build ```bash npm install npm run build:native npm run build npm start ``` `build:native` compiles whatever this machine supports into `bin/`: | Binary | Platform | |---|---| | `med_cpu` | macOS and Windows | | `med_gpu` | macOS Metal | | `med_cuda` | Windows (or `FORCE_CUDA=1` if `nvcc` is on the PATH) | ## Using the app 1. Set **Role** in the toolbar to Master or Slave. 2. Under **Devices**, tick local cards to use or expose. On the master, set **Block size** on each local and remote card; **Workers** (CPU thread count) appears only on CPU cards. 3. **Master:** choose the `.med` file, charset, min/max length, and pads. Optionally **Start service** so other computers can join. Click **Start search**. The master searches on its selected local devices and assigns a block of that device’s size to every exposed slave device. 4. **Slave:** tick the devices to expose, set CPU threads on CPU cards if needed, enter the master’s IP and port, and **Connect**. The slave does not set block size — the master does. Each exposed device stays listed on **Workers** with current-block progress and a completed-block count. The slave does not need the `.med` file. Hits are written under `decoded/bruteforce/` (`decrypted_*.bin`, `hit_*.json`, `results.json`). Do not expose the WebSocket port to the public internet; it has no authentication. ## Native runner CLI All three runners share the same commands: ``` med_* devices med_* selftest [--device N] med_* brute --device N --key-len L --charset S --pad XX \ --target HEX --fills HEX,... --start I --count N --batch B ``` Metal also needs `--shader native/metal/des_bruteforce.metal`. CPU accepts `--workers N`.