# nicoadresse/hjlix architecture

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

- Interactive diagram: https://gitdiagram.com/nicoadresse/hjlix
- Repository: https://github.com/nicoadresse/hjlix

## Overview

hjlix is a Rust command-line cryptography utility. Users select a command and algorithm through the CLI, provide strings or file paths, and receive hashes, encrypted/decrypted text, or Base64 results on stdout; some commands also support file output. The main workflow is CLI dispatch into distinct SHA-2, SHA-3/Keccak, AES-GCM, or Base64 implementations. AES-GCM additionally supports key generation and key-file-based decryption. The source index documents routing to several implementations whose bodies were not sampled, so those links reflect dispatch evidence rather than inspection of their internals.

Main entry points: [`src/cli/entcli.rs`](https://github.com/nicoadresse/hjlix/blob/main/src/cli/entcli.rs) (Command dispatch), [`src/cli/aes_gcm/aes_gcmstr_impl.rs`](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmstr_impl.rs) (String encryption), [`src/cli/aes_gcm/aes_gcmdecryption_impl.rs`](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmdecryption_impl.rs) (String decryption), [`src/cli/aes_gcm/aes_gcm_types.rs`](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcm_types.rs) (AES variants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_entrypoint["Program entry<br/>[main.rs]"]
  node_dispatch["Command dispatch<br/>[entcli.rs]"]
end

subgraph group_hash["Hashing"]
  node_sha2["SHA-2 processing<br/>[sha2str_impl.rs]"]
  node_sha2files["SHA-2 files<br/>[sha2file_impl.rs]"]
  node_sha2types["SHA-2 variants<br/>[sha2_types.rs]"]
  node_sha3["SHA-3 processing<br/>[sha3str_impl.rs]"]
  node_sha3files["SHA-3 files<br/>[sha3file_impl.rs]"]
  node_sha3types["SHA-3 variants<br/>[sha3_types.rs]"]
  node_digest["Digest interface<br/>[digest.rs]"]
end

subgraph group_crypto["AES-GCM"]
  node_aes_types["AES variants<br/>[aes_gcm_types.rs]"]
  node_aes_string["String encryption<br/>[aes_gcmstr_impl.rs]"]
  node_aes_file["File encryption"]
  node_aes_decrypt["String decryption"]
  node_aes_decrypt_file["File decryption"]
  node_key_trait["Key generation"]
  node_keyfile[("Local key file")]
end

subgraph group_encoding["Base64"]
  node_base64_encode["Base64 encoding"]
  node_base64_decode["Base64 decoding"]
  node_base64_types["Base64 engines<br/>[base64_types.rs]"]
end

node_user(("CLI user"))
node_terminal(("Terminal output"))

node_user -->|"runs command"| node_entrypoint
node_entrypoint -->|"starts CLI"| node_dispatch
node_dispatch -->|"dispatches string"| node_sha2
node_dispatch -->|"dispatches files"| node_sha2files
node_dispatch -->|"dispatches string"| node_sha3
node_dispatch -->|"dispatches files"| node_sha3files
node_sha2files -->|"digests lines"| node_sha2types
node_sha3files -->|"digests lines"| node_sha3types
node_sha2types -->|"implements"| node_digest
node_sha3types -->|"implements"| node_digest
node_dispatch -->|"dispatches encryption"| node_aes_string
node_dispatch -->|"dispatches encryption"| node_aes_file
node_dispatch -->|"dispatches decryption"| node_aes_decrypt
node_dispatch -->|"dispatches decryption"| node_aes_decrypt_file
node_aes_string -->|"selects cipher"| node_aes_types
node_aes_string -->|"generates key"| node_key_trait
node_aes_file -->|"uses cipher"| node_aes_types
node_aes_string -->|"writes generated key"| node_keyfile
node_aes_decrypt -->|"reads supplied key"| node_keyfile
node_aes_decrypt -->|"identifies cipher"| node_aes_types
node_aes_decrypt_file -->|"identifies cipher"| node_aes_types
node_dispatch -->|"dispatches encoding"| node_base64_encode
node_dispatch -->|"dispatches decoding"| node_base64_decode
node_base64_encode -->|"encodes variant"| node_base64_types
node_base64_decode -->|"decodes variant"| node_base64_types
node_sha2 -.->|"prints results"| node_terminal
node_sha2files -->|"prints results"| node_terminal
node_sha3files -->|"prints results"| node_terminal
node_aes_string -->|"prints ciphertext"| node_terminal
node_aes_decrypt -->|"prints plaintext"| node_terminal
node_base64_encode -.->|"prints results"| node_terminal
node_base64_decode -.->|"prints results"| node_terminal

click node_entrypoint "https://github.com/nicoadresse/hjlix/blob/main/src/main.rs"
click node_dispatch "https://github.com/nicoadresse/hjlix/blob/main/src/cli/entcli.rs"
click node_sha2 "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2str_impl.rs"
click node_sha2files "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2file_impl.rs"
click node_sha2types "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2_types.rs"
click node_sha3 "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3str_impl.rs"
click node_sha3files "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3file_impl.rs"
click node_sha3types "https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3_types.rs"
click node_digest "https://github.com/nicoadresse/hjlix/blob/main/src/cli/traits/digest.rs"
click node_aes_types "https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcm_types.rs"
click node_aes_string "https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmstr_impl.rs"
click node_aes_file "https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmfile_impl.rs"
click node_aes_decrypt "https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmdecryption_impl.rs"
click node_aes_decrypt_file "https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmdecryptionfile_impl.rs"
click node_key_trait "https://github.com/nicoadresse/hjlix/blob/main/src/cli/traits/generate_aes_key.rs"
click node_base64_encode "https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_encryption_impl.rs"
click node_base64_decode "https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_decryption_impl.rs"
click node_base64_types "https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_types.rs"

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_entrypoint,node_dispatch,node_user toneBlue
class node_sha2,node_sha2files,node_sha2types,node_sha3,node_sha3files,node_sha3types,node_digest toneAmber
class node_aes_types,node_aes_string,node_aes_file,node_aes_decrypt,node_aes_decrypt_file,node_key_trait,node_keyfile toneMint
class node_base64_encode,node_base64_decode,node_base64_types toneRose
class node_terminal toneIndigo
```

## Components

### CLI entry

- [Program entry](https://github.com/nicoadresse/hjlix/blob/main/src/main.rs): `src/main.rs`
- [Command dispatch](https://github.com/nicoadresse/hjlix/blob/main/src/cli/entcli.rs): `src/cli/entcli.rs`

### Hashing

- [SHA-2 processing](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2str_impl.rs): `src/cli/sha2/sha2str_impl.rs`
- [SHA-2 files](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2file_impl.rs): `src/cli/sha2/sha2file_impl.rs`
- [SHA-2 variants](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha2/sha2_types.rs): `src/cli/sha2/sha2_types.rs`
- [SHA-3 processing](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3str_impl.rs): `src/cli/sha3/sha3str_impl.rs`
- [SHA-3 files](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3file_impl.rs): `src/cli/sha3/sha3file_impl.rs`
- [SHA-3 variants](https://github.com/nicoadresse/hjlix/blob/main/src/cli/sha3/sha3_types.rs): `src/cli/sha3/sha3_types.rs`
- [Digest interface](https://github.com/nicoadresse/hjlix/blob/main/src/cli/traits/digest.rs): `src/cli/traits/digest.rs`

### AES-GCM

- [AES variants](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcm_types.rs): `src/cli/aes_gcm/aes_gcm_types.rs`
- [String encryption](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmstr_impl.rs): `src/cli/aes_gcm/aes_gcmstr_impl.rs`
- [File encryption](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmfile_impl.rs): `src/cli/aes_gcm/aes_gcmfile_impl.rs`
- [String decryption](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmdecryption_impl.rs): `src/cli/aes_gcm/aes_gcmdecryption_impl.rs`
- [File decryption](https://github.com/nicoadresse/hjlix/blob/main/src/cli/aes_gcm/aes_gcmdecryptionfile_impl.rs): `src/cli/aes_gcm/aes_gcmdecryptionfile_impl.rs`
- [Key generation](https://github.com/nicoadresse/hjlix/blob/main/src/cli/traits/generate_aes_key.rs): `src/cli/traits/generate_aes_key.rs`
- **Local key file**

### Base64

- [Base64 encoding](https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_encryption_impl.rs): `src/cli/base64/base64_encryption_impl.rs`
- [Base64 decoding](https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_decryption_impl.rs): `src/cli/base64/base64_decryption_impl.rs`
- [Base64 engines](https://github.com/nicoadresse/hjlix/blob/main/src/cli/base64/base64_types.rs): `src/cli/base64/base64_types.rs`

### Other components

- **CLI user**
- **Terminal output**

## Connections

- CLI user → Program entry: runs command (evidence: `README.md`)
- Program entry → Command dispatch: starts CLI (evidence: `src/main.rs`)
- Command dispatch → SHA-2 processing: dispatches string (evidence: `src/cli/entcli.rs`)
- Command dispatch → SHA-2 files: dispatches files (evidence: `src/cli/entcli.rs`)
- Command dispatch → SHA-3 processing: dispatches string (evidence: `src/cli/entcli.rs`)
- Command dispatch → SHA-3 files: dispatches files (evidence: `src/cli/entcli.rs`)
- SHA-2 files → SHA-2 variants: digests lines (evidence: `src/cli/sha2/sha2file_impl.rs`)
- SHA-3 files → SHA-3 variants: digests lines (evidence: `src/cli/sha3/sha3file_impl.rs`)
- SHA-2 variants → Digest interface: implements (evidence: `src/cli/sha2/sha2_types.rs`)
- SHA-3 variants → Digest interface: implements (evidence: `src/cli/sha3/sha3_types.rs`)
- Command dispatch → String encryption: dispatches encryption (evidence: `src/cli/entcli.rs`)
- Command dispatch → File encryption: dispatches encryption (evidence: `src/cli/entcli.rs`)
- Command dispatch → String decryption: dispatches decryption (evidence: `src/cli/entcli.rs`)
- Command dispatch → File decryption: dispatches decryption (evidence: `src/cli/entcli.rs`)
- String encryption → AES variants: selects cipher (evidence: `src/cli/aes_gcm/aes_gcmstr_impl.rs`)
- String encryption → Key generation: generates key (evidence: `src/cli/aes_gcm/aes_gcmstr_impl.rs`)
- File encryption → AES variants: uses cipher (evidence: `src/cli/aes_gcm/aes_gcmfile_impl.rs`)
- String encryption → Local key file: writes generated key (evidence: `src/cli/aes_gcm/aes_gcmstr_impl.rs`)
- String decryption → Local key file: reads supplied key (evidence: `src/cli/aes_gcm/aes_gcmdecryption_impl.rs`)
- String decryption → AES variants: identifies cipher (evidence: `src/cli/aes_gcm/aes_gcmdecryption_impl.rs`)
- File decryption → AES variants: identifies cipher (evidence: `src/cli/aes_gcm/aes_gcmdecryptionfile_impl.rs`)
- Command dispatch → Base64 encoding: dispatches encoding (evidence: `src/cli/entcli.rs`)
- Command dispatch → Base64 decoding: dispatches decoding (evidence: `src/cli/entcli.rs`)
- Base64 encoding → Base64 engines: encodes variant (evidence: `src/cli/base64/base64_encryption_impl.rs`)
- Base64 decoding → Base64 engines: decodes variant (evidence: `src/cli/base64/base64_decryption_impl.rs`)
- SHA-2 processing → Terminal output: prints results
- SHA-2 files → Terminal output: prints results (evidence: `src/cli/sha2/sha2file_impl.rs`)
- SHA-3 files → Terminal output: prints results (evidence: `src/cli/sha3/sha3file_impl.rs`)
- String encryption → Terminal output: prints ciphertext (evidence: `src/cli/aes_gcm/aes_gcmstr_impl.rs`)
- String decryption → Terminal output: prints plaintext (evidence: `src/cli/aes_gcm/aes_gcmdecryption_impl.rs`)
- Base64 encoding → Terminal output: prints results
- Base64 decoding → Terminal output: prints results
