# stellarispulvis/encrypt-tool architecture

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

- Interactive diagram: https://gitdiagram.com/stellarispulvis/encrypt-tool
- Repository: https://github.com/stellarispulvis/encrypt-tool

## Overview

Encrypt Tool is a small command-line utility: users generate a Fernet key, then encrypt or decrypt files using that key and configurable storage location. The single source file owns command dispatch, configuration, key handling, and file operations. The README documents these capabilities; all implementation relationships shown here are supported by the excerpted source.

Main entry points: [`encryptor.py`](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py) (Command dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_dispatch["Command dispatch<br/>[encryptor.py]"]
  node_help["Help output<br/>[encryptor.py]"]
end

subgraph group_security["Keys and crypto"]
  node_keygen["Key generation<br/>[encryptor.py]"]
  node_keyload["Key loading<br/>[encryptor.py]"]
  node_fernet["Fernet crypto"]
end

subgraph group_files["Configuration and files"]
  node_config["Config management<br/>[encryptor.py]"]
  node_configfile["config.toml"]
  node_keystore["Key file"]
  node_encrypt["File encryption<br/>[encryptor.py]"]
  node_decrypt["File decryption<br/>[encryptor.py]"]
end

node_user(("User"))
node_userfiles["User files"]

node_user -->|"runs commands"| node_dispatch
node_dispatch -->|"initializes"| node_config
node_dispatch -->|"dispatches"| node_keygen
node_dispatch -->|"dispatches"| node_encrypt
node_dispatch -->|"dispatches"| node_decrypt
node_dispatch -->|"displays"| node_help
node_config -->|"creates or reads"| node_configfile
node_keygen -->|"gets key location"| node_config
node_keygen -->|"generates key"| node_fernet
node_keygen -->|"writes key"| node_keystore
node_encrypt -->|"loads key"| node_keyload
node_decrypt -->|"loads key"| node_keyload
node_keyload -->|"gets key location"| node_config
node_keyload -->|"reads key"| node_keystore
node_encrypt -->|"encrypts data"| node_fernet
node_decrypt -->|"decrypts data"| node_fernet
node_encrypt -->|"reads and replaces"| node_userfiles
node_decrypt -->|"reads and replaces"| node_userfiles

click node_dispatch "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_help "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_keygen "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_keyload "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_config "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_encrypt "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py"
click node_decrypt "https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.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_dispatch,node_help,node_user,node_userfiles toneBlue
class node_keygen,node_keyload,node_fernet toneAmber
class node_config,node_configfile,node_keystore,node_encrypt,node_decrypt toneMint
```

## Components

### Command line

- [Command dispatch](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`
- [Help output](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`

### Keys and crypto

- [Key generation](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`
- [Key loading](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`
- **Fernet crypto**

### Configuration and files

- [Config management](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`
- **config.toml**
- **Key file**
- [File encryption](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`
- [File decryption](https://github.com/stellarispulvis/encrypt-tool/blob/main/encryptor.py): `encryptor.py`

### Other components

- **User**
- **User files**

## Connections

- User → Command dispatch: runs commands (evidence: `README.md`)
- Command dispatch → Config management: initializes (evidence: `encryptor.py`)
- Command dispatch → Key generation: dispatches (evidence: `encryptor.py`)
- Command dispatch → File encryption: dispatches (evidence: `encryptor.py`)
- Command dispatch → File decryption: dispatches (evidence: `encryptor.py`)
- Command dispatch → Help output: displays (evidence: `encryptor.py`)
- Config management → config.toml: creates or reads (evidence: `encryptor.py`)
- Key generation → Config management: gets key location (evidence: `encryptor.py`)
- Key generation → Fernet crypto: generates key (evidence: `encryptor.py`)
- Key generation → Key file: writes key (evidence: `encryptor.py`)
- File encryption → Key loading: loads key (evidence: `encryptor.py`)
- File decryption → Key loading: loads key (evidence: `encryptor.py`)
- Key loading → Config management: gets key location (evidence: `encryptor.py`)
- Key loading → Key file: reads key (evidence: `encryptor.py`)
- File encryption → Fernet crypto: encrypts data (evidence: `encryptor.py`)
- File decryption → Fernet crypto: decrypts data (evidence: `encryptor.py`)
- File encryption → User files: reads and replaces (evidence: `encryptor.py`)
- File decryption → User files: reads and replaces (evidence: `encryptor.py`)
