# irrelon/hikvision-password-extractor architecture

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

- Interactive diagram: https://gitdiagram.com/irrelon/hikvision-password-extractor
- Repository: https://github.com/irrelon/hikvision-password-extractor

## Overview

This Node.js CLI retrieves a Hikvision camera configuration and extracts candidate passwords. Its main workflow is explicit in index.js: download, AES-decrypt, XOR-decode, search for authentication patterns, then print results. The README documents the same stages. The graph covers the runtime modules and device interaction; the supplied excerpts do not show a separate password-result service or additional product subsystem.

Main entry points: [`index.js`](https://github.com/irrelon/hikvision-password-extractor/blob/master/index.js) (CLI workflow), [`downloadConfig.js`](https://github.com/irrelon/hikvision-password-extractor/blob/master/downloadConfig.js) (Config download), [`decryptAes.js`](https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptAes.js) (AES decryption), [`decryptXor.js`](https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptXor.js) (XOR decoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI orchestration"]
  node_cli["CLI workflow<br/>[index.js]"]
end

subgraph group_processing["Config processing"]
  node_download["Config download<br/>[downloadConfig.js]"]
  node_aes["AES decryption<br/>[decryptAes.js]"]
  node_xor["XOR decoding<br/>[decryptXor.js]"]
end

subgraph group_extraction["Password extraction"]
  node_search["Auth pattern search<br/>[findAuth.js]"]
  node_results["Password results"]
end

node_user(("Operator"))
node_camera["Hikvision camera"]

node_user -->|"runs with IP"| node_cli
node_cli -->|"calls download"| node_download
node_download -->|"requests config"| node_camera
node_download -->|"writes config file"| node_aes
node_cli -->|"calls decrypt"| node_aes
node_aes -->|"writes decrypted file"| node_xor
node_cli -->|"calls decode"| node_xor
node_xor -->|"writes decoded text"| node_search
node_cli -->|"calls search"| node_search
node_search -->|"returns matches"| node_results
node_cli -->|"prints passwords"| node_results

click node_cli "https://github.com/irrelon/hikvision-password-extractor/blob/master/index.js"
click node_download "https://github.com/irrelon/hikvision-password-extractor/blob/master/downloadConfig.js"
click node_aes "https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptAes.js"
click node_xor "https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptXor.js"
click node_search "https://github.com/irrelon/hikvision-password-extractor/blob/master/findAuth.js"

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 toneBlue
class node_download,node_aes,node_xor toneAmber
class node_search,node_results toneMint
class node_user,node_camera toneIndigo
```

## Components

### CLI orchestration

- [CLI workflow](https://github.com/irrelon/hikvision-password-extractor/blob/master/index.js): `index.js`

### Config processing

- [Config download](https://github.com/irrelon/hikvision-password-extractor/blob/master/downloadConfig.js): `downloadConfig.js`
- [AES decryption](https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptAes.js): `decryptAes.js`
- [XOR decoding](https://github.com/irrelon/hikvision-password-extractor/blob/master/decryptXor.js): `decryptXor.js`

### Password extraction

- [Auth pattern search](https://github.com/irrelon/hikvision-password-extractor/blob/master/findAuth.js): `findAuth.js`
- **Password results**

### Other components

- **Operator**
- **Hikvision camera**

## Connections

- Operator → CLI workflow: runs with IP (evidence: `README.md`)
- CLI workflow → Config download: calls download (evidence: `index.js`)
- Config download → Hikvision camera: requests config (evidence: `downloadConfig.js`)
- Config download → AES decryption: writes config file (evidence: `README.md`)
- CLI workflow → AES decryption: calls decrypt (evidence: `index.js`)
- AES decryption → XOR decoding: writes decrypted file (evidence: `README.md`)
- CLI workflow → XOR decoding: calls decode (evidence: `index.js`)
- XOR decoding → Auth pattern search: writes decoded text (evidence: `README.md`)
- CLI workflow → Auth pattern search: calls search (evidence: `index.js`)
- Auth pattern search → Password results: returns matches (evidence: `findAuth.js`)
- CLI workflow → Password results: prints passwords (evidence: `index.js`)
