# starsgiri/crypto-ency-decry architecture

> Architecture diagram of the GitHub repository starsgiri/crypto-ency-decry, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/starsgiri/crypto-ency-decry
- Repository: https://github.com/starsgiri/crypto-ency-decry

## Overview

CipherCore is a Streamlit application for encrypting and decrypting text and images with ten cipher configurations. Users choose a text or image workflow; encryption derives a key from the passphrase, encrypts the content, and returns a compact token. Decryption reads the token’s algorithm identifier and recovers the content. The image workflow additionally compresses uploads and restores decrypted images. The app is a single-file implementation: the README documents major behavior, while the excerpts show only selected internals, so edges for unsampled UI and image steps rely on that documentation.

Main entry points: [`app.py`](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py) (Raw encryption)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit_ui["Streamlit interface<br/>[app.py]"]
  node_text_workflow["Text workflow<br/>[app.py]"]
  node_image_controls["Image controls<br/>[app.py]"]
  node_strength_indicator["Passphrase feedback<br/>[app.py]"]
end

subgraph group_crypto["Cryptography and tokens"]
  node_kdf["Key derivation<br/>[app.py]"]
  node_algorithm_suite["Cipher suite<br/>[app.py]"]
  node_raw_crypto["Raw encryption<br/>[app.py]"]
  node_text_token["Text token codec<br/>[app.py]"]
  node_token_detection["Token algorithm detection<br/>[app.py]"]
end

subgraph group_images["Image workflow"]
  node_image_upload["Image upload and preview<br/>[app.py]"]
  node_image_compression["Image compression<br/>[app.py]"]
  node_image_token["Image token codec<br/>[app.py]"]
  node_image_restore["Image restoration<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_streamlit_ui
node_streamlit_ui -->|"selects mode"| node_text_workflow
node_streamlit_ui -->|"selects mode"| node_image_controls
node_text_workflow -->|"shows feedback"| node_strength_indicator
node_text_workflow -->|"encrypts or decrypts"| node_raw_crypto
node_raw_crypto -.->|"derives key"| node_kdf
node_raw_crypto -.->|"uses cipher"| node_algorithm_suite
node_raw_crypto -->|"packs or unpacks"| node_text_token
node_text_workflow -->|"detects algorithm"| node_token_detection
node_token_detection -->|"selects decryption"| node_raw_crypto
node_image_controls -->|"accepts image"| node_image_upload
node_image_upload -->|"compresses image"| node_image_compression
node_image_compression -->|"encrypts payload"| node_raw_crypto
node_image_controls -->|"handles image token"| node_image_token
node_image_token -.->|"restores image"| node_image_restore

click node_streamlit_ui "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_text_workflow "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_image_controls "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_strength_indicator "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_kdf "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_algorithm_suite "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_raw_crypto "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_text_token "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_token_detection "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_image_upload "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_image_compression "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_image_token "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py"
click node_image_restore "https://github.com/starsgiri/crypto-ency-decry/blob/main/app.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_streamlit_ui,node_text_workflow,node_image_controls,node_strength_indicator,node_user toneBlue
class node_kdf,node_algorithm_suite,node_raw_crypto,node_text_token,node_token_detection toneAmber
class node_image_upload,node_image_compression,node_image_token,node_image_restore toneMint
```

## Components

### User interface

- [Streamlit interface](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Text workflow](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Image controls](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Passphrase feedback](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`

### Cryptography and tokens

- [Key derivation](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Cipher suite](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Raw encryption](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Text token codec](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Token algorithm detection](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`

### Image workflow

- [Image upload and preview](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Image compression](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Image token codec](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`
- [Image restoration](https://github.com/starsgiri/crypto-ency-decry/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Streamlit interface: uses (evidence: `README.md`)
- Streamlit interface → Text workflow: selects mode (evidence: `README.md`)
- Streamlit interface → Image controls: selects mode (evidence: `README.md`)
- Text workflow → Passphrase feedback: shows feedback (evidence: `README.md`)
- Text workflow → Raw encryption: encrypts or decrypts (evidence: `README.md`)
- Raw encryption → Key derivation: derives key (evidence: `app.py`)
- Raw encryption → Cipher suite: uses cipher (evidence: `app.py`)
- Raw encryption → Text token codec: packs or unpacks (evidence: `app.py`)
- Text workflow → Token algorithm detection: detects algorithm (evidence: `README.md`)
- Token algorithm detection → Raw encryption: selects decryption (evidence: `README.md`)
- Image controls → Image upload and preview: accepts image (evidence: `README.md`)
- Image upload and preview → Image compression: compresses image (evidence: `README.md`)
- Image compression → Raw encryption: encrypts payload (evidence: `README.md`)
- Image controls → Image token codec: handles image token (evidence: `README.md`)
- Image token codec → Image restoration: restores image (evidence: `app.py`)
