# alonanazarenko/cryptography-task-2 architecture

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

- Interactive diagram: https://gitdiagram.com/alonanazarenko/cryptography-task-2
- Repository: https://github.com/alonanazarenko/cryptography-task-2

## Overview

This repository implements the Strumok-256/512 stream cipher and demonstrates its use, alongside a Strumok-512 partial-guessing attack workflow. Users can encrypt and decrypt messages through the example, or generate cipher relations for Autoguess and check cipher-state equations in a simulation. The cipher’s state-transition and output logic form the runtime core; lookup tables support its transforms. The README documents the Autoguess workflow, while the sampled scripts show relation generation, a bonus search, and verification. The Autoguess dependency is external to this repository.

Main entry points: [`Simulate_attack.py`](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Simulate_attack.py) (Attack simulation), [`Strumok.py`](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Strumok.py) (Strumok cipher), [`Generate_strumok.py`](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Generate_strumok.py) (Relation generator), [`Additional.py`](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Additional.py) (Bonus relation search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cipher["Cipher runtime"]
  node_strumok["Strumok cipher<br/>[Strumok.py]"]
  node_tables["Transform tables<br/>[Strumok_tabels.py]"]
end

subgraph group_attack["Attack modeling"]
  node_relation_generator["Relation generator"]
  node_bonus_search["Bonus relation search<br/>[Additional.py]"]
  node_autoguess["Autoguess"]
end

subgraph group_demonstrations["Usage and verification"]
  node_example["Encrypt example<br/>[example_usage.py]"]
  node_attack_simulation["Attack simulation<br/>[Simulate_attack.py]"]
end

node_user(("User"))

node_user -->|"runs"| node_example
node_example -->|"encrypts with"| node_strumok
node_strumok -->|"uses transforms"| node_tables
node_user -->|"runs"| node_relation_generator
node_relation_generator -->|"provides relations"| node_autoguess
node_user -->|"runs"| node_bonus_search
node_bonus_search -->|"launches search"| node_autoguess
node_user -->|"runs"| node_attack_simulation
node_attack_simulation -->|"simulates cipher"| node_strumok
node_attack_simulation -->|"uses transforms"| node_tables

click node_example "https://github.com/alonanazarenko/cryptography-task-2/blob/main/example_usage.py"
click node_strumok "https://github.com/alonanazarenko/cryptography-task-2/blob/main/Strumok.py"
click node_tables "https://github.com/alonanazarenko/cryptography-task-2/blob/main/Strumok_tabels.py"
click node_relation_generator "https://github.com/alonanazarenko/cryptography-task-2/blob/main/Generate_strumok.py"
click node_bonus_search "https://github.com/alonanazarenko/cryptography-task-2/blob/main/Additional.py"
click node_attack_simulation "https://github.com/alonanazarenko/cryptography-task-2/blob/main/Simulate_attack.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_strumok,node_tables,node_user toneBlue
class node_relation_generator,node_bonus_search,node_autoguess toneAmber
class node_example,node_attack_simulation toneMint
```

## Components

### Cipher runtime

- [Strumok cipher](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Strumok.py): `Strumok.py`
- [Transform tables](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Strumok_tabels.py): `Strumok_tabels.py`

### Attack modeling

- [Relation generator](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Generate_strumok.py): `Generate_strumok.py`
- [Bonus relation search](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Additional.py): `Additional.py`
- **Autoguess**

### Usage and verification

- [Encrypt example](https://github.com/alonanazarenko/cryptography-task-2/blob/main/example_usage.py): `example_usage.py`
- [Attack simulation](https://github.com/alonanazarenko/cryptography-task-2/blob/main/Simulate_attack.py): `Simulate_attack.py`

### Other components

- **User**

## Connections

- User → Encrypt example: runs (evidence: `README.md`)
- Encrypt example → Strumok cipher: encrypts with (evidence: `example_usage.py`)
- Strumok cipher → Transform tables: uses transforms (evidence: `Strumok.py`)
- User → Relation generator: runs (evidence: `README.md`)
- Relation generator → Autoguess: provides relations (evidence: `README.md`)
- User → Bonus relation search: runs (evidence: `README.md`)
- Bonus relation search → Autoguess: launches search (evidence: `Additional.py`)
- User → Attack simulation: runs (evidence: `README.md`)
- Attack simulation → Strumok cipher: simulates cipher (evidence: `Simulate_attack.py`)
- Attack simulation → Transform tables: uses transforms (evidence: `Simulate_attack.py`)
