# abyanptrn/clavis architecture

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

- Interactive diagram: https://gitdiagram.com/abyanptrn/clavis
- Repository: https://github.com/abyanptrn/clavis

## Overview

Clavis is a single-file interactive CLI for encrypting and decrypting text or files with AES-GCM. The workflow selects an operation and input type, obtains a password, then dispatches to text or file handling; both use the same salted encryption format and scrypt-derived key. File handling reads the source and writes a derived output path. All runtime code is in clavis.py; relationships shown are supported by its excerpt. There is no README or evidence of additional product subsystems.

Main entry points: [`clavis.py`](https://github.com/abyanptrn/clavis/blob/main/clavis.py) (CLI orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["CLI orchestration<br/>[clavis.py]"]
node_prompts["Menu and password prompts<br/>[clavis.py]"]
node_text["Text processing<br/>[clavis.py]"]
node_files["File processing<br/>[clavis.py]"]
node_crypto["Encrypt and decrypt<br/>[clavis.py]"]
node_kdf["Scrypt key derivation<br/>[clavis.py]"]
node_aesgcm["AES-GCM library"]
node_filesystem[("Local filesystem")]

node_user -->|"starts"| node_cli
node_cli -->|"requests choices"| node_prompts
node_prompts -->|"prompts for input"| node_user
node_cli -->|"dispatches to"| node_text
node_cli -->|"dispatches to"| node_files
node_text -->|"reads and prints"| node_user
node_files -->|"reads and writes"| node_filesystem
node_text -->|"encrypts or decrypts"| node_crypto
node_files -->|"encrypts or decrypts"| node_crypto
node_crypto -->|"derives key"| node_kdf
node_crypto -->|"encrypts or decrypts"| node_aesgcm

click node_cli "https://github.com/abyanptrn/clavis/blob/main/clavis.py"
click node_prompts "https://github.com/abyanptrn/clavis/blob/main/clavis.py"
click node_text "https://github.com/abyanptrn/clavis/blob/main/clavis.py"
click node_files "https://github.com/abyanptrn/clavis/blob/main/clavis.py"
click node_crypto "https://github.com/abyanptrn/clavis/blob/main/clavis.py"
click node_kdf "https://github.com/abyanptrn/clavis/blob/main/clavis.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_user toneBlue
class node_cli,node_prompts,node_text,node_files,node_crypto,node_kdf toneTeal
class node_aesgcm toneIndigo
class node_filesystem toneAmber
```

## Components

### Other components

- **User**
- [CLI orchestration](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- [Menu and password prompts](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- [Text processing](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- [File processing](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- [Encrypt and decrypt](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- [Scrypt key derivation](https://github.com/abyanptrn/clavis/blob/main/clavis.py): `clavis.py`
- **AES-GCM library**
- **Local filesystem**

## Connections

- User → CLI orchestration: starts (evidence: `clavis.py`)
- CLI orchestration → Menu and password prompts: requests choices (evidence: `clavis.py`)
- Menu and password prompts → User: prompts for input (evidence: `clavis.py`)
- CLI orchestration → Text processing: dispatches to (evidence: `clavis.py`)
- CLI orchestration → File processing: dispatches to (evidence: `clavis.py`)
- Text processing → User: reads and prints (evidence: `clavis.py`)
- File processing → Local filesystem: reads and writes (evidence: `clavis.py`)
- Text processing → Encrypt and decrypt: encrypts or decrypts (evidence: `clavis.py`)
- File processing → Encrypt and decrypt: encrypts or decrypts (evidence: `clavis.py`)
- Encrypt and decrypt → Scrypt key derivation: derives key (evidence: `clavis.py`)
- Encrypt and decrypt → AES-GCM library: encrypts or decrypts (evidence: `clavis.py`)
