# clippywashere/clip-togra-py architecture

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

- Interactive diagram: https://gitdiagram.com/clippywashere/clip-togra-py
- Repository: https://github.com/clippywashere/clip-togra-py

## Overview

Clip-togra-py is an interactive CLI multitool for encrypting and decrypting classical ciphers, plus heuristic frequency analysis and matching. Users select an operation and cipher in the main menu, then the selected routine prompts for text and any keys or alphabet settings and prints its result. The cipher modules cover substitution, transposition, mixed, and other methods; Columnar Transposition currently has encryption only. Shared constructors and validators support several Polybius-based and alphabet-based ciphers. The graph follows documented menu dispatch and excerpted helper calls; unsampled implementations are included as capabilities, without inferred internal links.

Main entry points: [`cryptography_main.py`](https://github.com/clippywashere/clip-togra-py/blob/main/cryptography_main.py) (Operation menu), [`constructors_and_validators.py`](https://github.com/clippywashere/clip-togra-py/blob/main/constructors_and_validators.py) (Alphabet and validators), [`s_affine.py`](https://github.com/clippywashere/clip-togra-py/blob/main/s_affine.py) (Affine cipher), [`s_nihilist.py`](https://github.com/clippywashere/clip-togra-py/blob/main/s_nihilist.py) (Nihilist cipher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dispatch["CLI dispatch"]
  node_main["Operation menu"]
end

subgraph group_cipher["Cipher routines"]
  node_affine["Affine cipher<br/>[s_affine.py]"]
  node_book["Book cipher<br/>[s_book.py]"]
  node_morse["Morse cipher<br/>[s_morse.py]"]
  node_nihilist["Nihilist cipher<br/>[s_nihilist.py]"]
  node_playfair["Playfair cipher<br/>[s_playfair.py]"]
  node_tapcode["Tapcode cipher<br/>[s_tapcode.py]"]
  node_columnar["Columnar transposition<br/>[t_columnar.py]"]
  node_bifid["Bifid cipher<br/>[m_bifid.py]"]
  node_pseudomorse["Pseudomorse cipher<br/>[o_pseudomorse.py]"]
end

subgraph group_shared["Tools and shared logic"]
  node_frequency["Frequency tools<br/>[l_frequency.py]"]
  node_constructors["Alphabet and validators"]
end

node_user(("CLI user"))

node_user -->|"selects operation"| node_main
node_main -->|"dispatches"| node_morse
node_main -->|"dispatches"| node_affine
node_main -->|"dispatches"| node_tapcode
node_main -->|"dispatches"| node_playfair
node_main -->|"dispatches"| node_book
node_main -->|"dispatches"| node_nihilist
node_main -->|"dispatches"| node_columnar
node_main -->|"dispatches"| node_bifid
node_main -->|"dispatches"| node_pseudomorse
node_main -->|"dispatches"| node_frequency
node_affine -->|"uses alphabet and validation"| node_constructors
node_nihilist -->|"uses Polybius helpers"| node_constructors
node_playfair -->|"uses Polybius helpers"| node_constructors
node_tapcode -->|"uses Polybius helpers"| node_constructors
node_bifid -->|"uses Polybius helpers"| node_constructors

click node_main "https://github.com/clippywashere/clip-togra-py/blob/main/cryptography_main.py"
click node_affine "https://github.com/clippywashere/clip-togra-py/blob/main/s_affine.py"
click node_book "https://github.com/clippywashere/clip-togra-py/blob/main/s_book.py"
click node_morse "https://github.com/clippywashere/clip-togra-py/blob/main/s_morse.py"
click node_nihilist "https://github.com/clippywashere/clip-togra-py/blob/main/s_nihilist.py"
click node_playfair "https://github.com/clippywashere/clip-togra-py/blob/main/s_playfair.py"
click node_tapcode "https://github.com/clippywashere/clip-togra-py/blob/main/s_tapcode.py"
click node_columnar "https://github.com/clippywashere/clip-togra-py/blob/main/t_columnar.py"
click node_bifid "https://github.com/clippywashere/clip-togra-py/blob/main/m_bifid.py"
click node_pseudomorse "https://github.com/clippywashere/clip-togra-py/blob/main/o_pseudomorse.py"
click node_frequency "https://github.com/clippywashere/clip-togra-py/blob/main/l_frequency.py"
click node_constructors "https://github.com/clippywashere/clip-togra-py/blob/main/constructors_and_validators.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_main,node_user toneBlue
class node_affine,node_book,node_morse,node_nihilist,node_playfair,node_tapcode,node_columnar,node_bifid,node_pseudomorse toneAmber
class node_frequency,node_constructors toneMint
```

## Components

### CLI dispatch

- [Operation menu](https://github.com/clippywashere/clip-togra-py/blob/main/cryptography_main.py): `cryptography_main.py`

### Cipher routines

- [Affine cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_affine.py): `s_affine.py`
- [Book cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_book.py): `s_book.py`
- [Morse cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_morse.py): `s_morse.py`
- [Nihilist cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_nihilist.py): `s_nihilist.py`
- [Playfair cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_playfair.py): `s_playfair.py`
- [Tapcode cipher](https://github.com/clippywashere/clip-togra-py/blob/main/s_tapcode.py): `s_tapcode.py`
- [Columnar transposition](https://github.com/clippywashere/clip-togra-py/blob/main/t_columnar.py): `t_columnar.py`
- [Bifid cipher](https://github.com/clippywashere/clip-togra-py/blob/main/m_bifid.py): `m_bifid.py`
- [Pseudomorse cipher](https://github.com/clippywashere/clip-togra-py/blob/main/o_pseudomorse.py): `o_pseudomorse.py`

### Tools and shared logic

- [Frequency tools](https://github.com/clippywashere/clip-togra-py/blob/main/l_frequency.py): `l_frequency.py`
- [Alphabet and validators](https://github.com/clippywashere/clip-togra-py/blob/main/constructors_and_validators.py): `constructors_and_validators.py`

### Other components

- **CLI user**

## Connections

- CLI user → Operation menu: selects operation (evidence: `README.md`)
- Operation menu → Morse cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Affine cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Tapcode cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Playfair cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Book cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Nihilist cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Columnar transposition: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Bifid cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Pseudomorse cipher: dispatches (evidence: `cryptography_main.py`)
- Operation menu → Frequency tools: dispatches (evidence: `cryptography_main.py`)
- Affine cipher → Alphabet and validators: uses alphabet and validation (evidence: `s_affine.py`)
- Nihilist cipher → Alphabet and validators: uses Polybius helpers (evidence: `s_nihilist.py`)
- Playfair cipher → Alphabet and validators: uses Polybius helpers (evidence: `s_playfair.py`)
- Tapcode cipher → Alphabet and validators: uses Polybius helpers (evidence: `s_tapcode.py`)
- Bifid cipher → Alphabet and validators: uses Polybius helpers (evidence: `m_bifid.py`)
