# oscarg10101/capc-cipher architecture

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

- Interactive diagram: https://gitdiagram.com/oscarg10101/capc-cipher
- Repository: https://github.com/oscarg10101/capc-cipher

## Overview

CAPC Cipher is a small C# console application for experimenting with reversible affine, polyalphabetic substitution over a 27-letter Spanish alphabet. The user enters text and a key; the program encrypts the text, then decrypts the produced ciphertext and displays both results. In the sampled implementation, encryption and decryption each normalize inputs, generate a repeated key stream, and apply modular substitution. The README describes whitespace preservation and accent removal; punctuation and other unsupported characters are skipped. All implementation nodes use the single sampled source file.

Main entry points: [`Encriptacion1/Program.cs`](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs) (Console workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_main["Console workflow<br/>[Program.cs]"]
node_encrypt["Encrypt text<br/>[Program.cs]"]
node_decrypt["Decrypt text<br/>[Program.cs]"]
node_normalize["Normalize text<br/>[Program.cs]"]
node_keygen["Generate key stream<br/>[Program.cs]"]
node_substitute["Modular substitution<br/>[Program.cs]"]
node_alphabet["Alphabet and coefficients<br/>[Program.cs]"]

node_user -->|"enters text and key"| node_main
node_main -->|"calls"| node_encrypt
node_encrypt -->|"returns ciphertext"| node_main
node_main -->|"calls with ciphertext"| node_decrypt
node_decrypt -->|"returns plaintext"| node_main
node_main -->|"displays results"| node_user
node_encrypt -->|"normalizes inputs"| node_normalize
node_encrypt -->|"generates key stream"| node_keygen
node_encrypt -->|"transforms letters"| node_substitute
node_decrypt -->|"normalizes key"| node_normalize
node_decrypt -->|"generates key stream"| node_keygen
node_decrypt -->|"reverses letters"| node_substitute
node_substitute -->|"uses values"| node_alphabet

click node_main "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_encrypt "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_decrypt "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_normalize "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_keygen "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_substitute "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"
click node_alphabet "https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs"

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_main,node_encrypt,node_decrypt,node_normalize,node_keygen,node_substitute,node_alphabet toneTeal
```

## Components

### Other components

- **User**
- [Console workflow](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Encrypt text](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Decrypt text](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Normalize text](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Generate key stream](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Modular substitution](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`
- [Alphabet and coefficients](https://github.com/oscarg10101/capc-cipher/blob/main/Encriptacion1/Program.cs): `Encriptacion1/Program.cs`

## Connections

- User → Console workflow: enters text and key
- Console workflow → Encrypt text: calls
- Encrypt text → Console workflow: returns ciphertext
- Console workflow → Decrypt text: calls with ciphertext
- Decrypt text → Console workflow: returns plaintext
- Console workflow → User: displays results
- Encrypt text → Normalize text: normalizes inputs
- Encrypt text → Generate key stream: generates key stream
- Encrypt text → Modular substitution: transforms letters
- Decrypt text → Normalize text: normalizes key
- Decrypt text → Generate key stream: generates key stream
- Decrypt text → Modular substitution: reverses letters
- Modular substitution → Alphabet and coefficients: uses values
