# nathan-samms/cipher architecture

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

- Interactive diagram: https://gitdiagram.com/nathan-samms/cipher
- Repository: https://github.com/nathan-samms/cipher

## Overview

This small Python repository contains standalone classical-cipher operations, a Caesar frequency-analysis tool, and an AES S-box/transform prototype. There is no README or documented user workflow. The analysis module imports the classical-cipher module, while the AES code is separate; the excerpts do not establish a broader encryption pipeline. The AES implementation shown is partial, and source inspection is limited to the supplied excerpts.

Main entry points: [`analysisTools.py`](https://github.com/nathan-samms/cipher/blob/main/analysisTools.py) (Frequency Scoring), [`AES.py`](https://github.com/nathan-samms/cipher/blob/main/AES.py) (AES Transforms), [`classicCiphers.py`](https://github.com/nathan-samms/cipher/blob/main/classicCiphers.py) (Classical Cipher API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cipher["Classical Ciphers"]
  node_classical["Classical Cipher API<br/>[classicCiphers.py]"]
end

subgraph group_analysis["Cipher Analysis"]
  node_frequency["Frequency Scoring<br/>[analysisTools.py]"]
  node_caesar_break["Caesar Analysis<br/>[analysisTools.py]"]
end

subgraph group_aes["AES Prototype"]
  node_aes_sbox["S-Box Setup<br/>[AES.py]"]
  node_aes_transforms["AES Transforms<br/>[AES.py]"]
end

node_user(("Caller"))

node_user -->|"encodes or decodes"| node_classical
node_user -->|"requests analysis"| node_caesar_break
node_caesar_break -->|"scores text"| node_frequency
node_frequency -->|"gets alphabet"| node_classical
node_user -->|"runs prototype"| node_aes_transforms
node_aes_transforms -->|"uses substitution table"| node_aes_sbox

click node_classical "https://github.com/nathan-samms/cipher/blob/main/classicCiphers.py"
click node_frequency "https://github.com/nathan-samms/cipher/blob/main/analysisTools.py"
click node_caesar_break "https://github.com/nathan-samms/cipher/blob/main/analysisTools.py"
click node_aes_sbox "https://github.com/nathan-samms/cipher/blob/main/AES.py"
click node_aes_transforms "https://github.com/nathan-samms/cipher/blob/main/AES.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_classical toneBlue
class node_frequency,node_caesar_break toneAmber
class node_aes_sbox,node_aes_transforms toneMint
class node_user toneIndigo
```

## Components

### Classical Ciphers

- [Classical Cipher API](https://github.com/nathan-samms/cipher/blob/main/classicCiphers.py): `classicCiphers.py`

### Cipher Analysis

- [Frequency Scoring](https://github.com/nathan-samms/cipher/blob/main/analysisTools.py): `analysisTools.py`
- [Caesar Analysis](https://github.com/nathan-samms/cipher/blob/main/analysisTools.py): `analysisTools.py`

### AES Prototype

- [S-Box Setup](https://github.com/nathan-samms/cipher/blob/main/AES.py): `AES.py`
- [AES Transforms](https://github.com/nathan-samms/cipher/blob/main/AES.py): `AES.py`

### Other components

- **Caller**

## Connections

- Caller → Classical Cipher API: encodes or decodes (evidence: `classicCiphers.py`)
- Caller → Caesar Analysis: requests analysis (evidence: `analysisTools.py`)
- Caesar Analysis → Frequency Scoring: scores text (evidence: `analysisTools.py`)
- Frequency Scoring → Classical Cipher API: gets alphabet (evidence: `analysisTools.py`)
- Caller → AES Transforms: runs prototype (evidence: `AES.py`)
- AES Transforms → S-Box Setup: uses substitution table (evidence: `AES.py`)
