# rino237gk/rino-lock architecture

> Architecture diagram of the GitHub repository rino237gk/rino-lock, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rino237gk/rino-lock
- Repository: https://github.com/rino237gk/rino-lock

## Overview

RINO is a desktop file locker with two implementations: the README-described streaming, password-based application in `rino.py`, and a separate TOTP/keyring variant in `rino2.py`. The user selects a file and starts encryption or decryption; the app authenticates or validates the password, runs cryptography, and writes the result to its configured folder. The streaming version also uses a background worker, progress reporting, temporary output, and optional secure deletion. The README documents capabilities beyond the sampled excerpts; the graph does not assume unshown connections between versions.

Main entry points: [`rino2.py`](https://github.com/rino237gk/rino-lock/blob/main/rino2.py) (Locker UI), [`rino.py`](https://github.com/rino237gk/rino-lock/blob/main/rino.py) (Locker UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_streaming["Streaming locker"]
  node_rino_ui["Locker UI<br/>[rino.py]"]
  node_rino_worker["Background worker<br/>[rino.py]"]
  node_rino_crypto["Streaming crypto<br/>[rino.py]"]
  node_rino_password["Password policy<br/>[rino.py]"]
  node_rino_delete["Secure deletion<br/>[rino.py]"]
end

subgraph group_totp["TOTP locker"]
  node_rino2_ui["Locker UI<br/>[rino2.py]"]
  node_totp_setup["TOTP setup<br/>[rino2.py]"]
  node_totp_verify["TOTP verification<br/>[rino2.py]"]
  node_rino2_crypto["File encryption<br/>[rino2.py]"]
  node_rino2_decryption["File decryption<br/>[rino2.py]"]
  node_rino2_key["Key derivation<br/>[rino2.py]"]
  node_rino2_delete["Secure deletion<br/>[rino2.py]"]
  node_qr_display["QR display<br/>[rino2.py]"]
end

subgraph group_storage["Files and secrets"]
  node_file_system[("Local files")]
  node_credential_store[("OS credential store")]
end

node_user(("User"))
node_authenticator["Authenticator app"]

node_user -->|"operates"| node_rino_ui
node_rino_ui -->|"checks password"| node_rino_password
node_rino_ui -->|"starts task"| node_rino_worker
node_rino_worker -->|"runs task"| node_rino_crypto
node_rino_crypto -->|"streams files"| node_file_system
node_rino_crypto -->|"writes temporary output"| node_file_system
node_rino_worker -->|"optionally deletes"| node_rino_delete
node_rino_delete -->|"overwrites and removes"| node_file_system
node_user -->|"operates"| node_rino2_ui
node_rino2_ui -->|"initializes"| node_totp_setup
node_totp_setup -->|"loads or saves secret"| node_credential_store
node_totp_setup -->|"shows QR code"| node_qr_display
node_qr_display -->|"provisions"| node_authenticator
node_rino2_ui -->|"checks code"| node_totp_verify
node_rino2_ui -->|"encrypts after verification"| node_rino2_crypto
node_rino2_ui -->|"decrypts after verification"| node_rino2_decryption
node_rino2_crypto -->|"derives key"| node_rino2_key
node_rino2_decryption -->|"derives key"| node_rino2_key
node_rino2_crypto -->|"reads and writes"| node_file_system
node_rino2_decryption -->|"reads and writes"| node_file_system
node_rino2_ui -->|"optionally deletes"| node_rino2_delete
node_rino2_delete -->|"overwrites and removes"| node_file_system

click node_rino_ui "https://github.com/rino237gk/rino-lock/blob/main/rino.py"
click node_rino_worker "https://github.com/rino237gk/rino-lock/blob/main/rino.py"
click node_rino_crypto "https://github.com/rino237gk/rino-lock/blob/main/rino.py"
click node_rino_password "https://github.com/rino237gk/rino-lock/blob/main/rino.py"
click node_rino_delete "https://github.com/rino237gk/rino-lock/blob/main/rino.py"
click node_rino2_ui "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_totp_setup "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_totp_verify "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_rino2_crypto "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_rino2_decryption "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_rino2_key "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_rino2_delete "https://github.com/rino237gk/rino-lock/blob/main/rino2.py"
click node_qr_display "https://github.com/rino237gk/rino-lock/blob/main/rino2.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_rino_ui,node_rino_worker,node_rino_crypto,node_rino_password,node_rino_delete,node_user toneBlue
class node_rino2_ui,node_totp_setup,node_totp_verify,node_rino2_crypto,node_rino2_decryption,node_rino2_key,node_rino2_delete,node_qr_display toneAmber
class node_file_system,node_credential_store toneMint
class node_authenticator toneIndigo
```

## Components

### Streaming locker

- [Locker UI](https://github.com/rino237gk/rino-lock/blob/main/rino.py): `rino.py`
- [Background worker](https://github.com/rino237gk/rino-lock/blob/main/rino.py): `rino.py`
- [Streaming crypto](https://github.com/rino237gk/rino-lock/blob/main/rino.py): `rino.py`
- [Password policy](https://github.com/rino237gk/rino-lock/blob/main/rino.py): `rino.py`
- [Secure deletion](https://github.com/rino237gk/rino-lock/blob/main/rino.py): `rino.py`

### TOTP locker

- [Locker UI](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [TOTP setup](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [TOTP verification](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [File encryption](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [File decryption](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [Key derivation](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [Secure deletion](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`
- [QR display](https://github.com/rino237gk/rino-lock/blob/main/rino2.py): `rino2.py`

### Files and secrets

- **Local files**
- **OS credential store**

### Other components

- **User**
- **Authenticator app**

## Connections

- User → Locker UI: operates (evidence: `README.md`)
- Locker UI → Password policy: checks password (evidence: `rino.py`)
- Locker UI → Background worker: starts task (evidence: `rino.py`)
- Background worker → Streaming crypto: runs task (evidence: `rino.py`)
- Streaming crypto → Local files: streams files (evidence: `README.md`)
- Streaming crypto → Local files: writes temporary output (evidence: `rino.py`)
- Background worker → Secure deletion: optionally deletes (evidence: `rino.py`)
- Secure deletion → Local files: overwrites and removes (evidence: `README.md`)
- User → Locker UI: operates (evidence: `rino2.py`)
- Locker UI → TOTP setup: initializes (evidence: `rino2.py`)
- TOTP setup → OS credential store: loads or saves secret (evidence: `rino2.py`)
- TOTP setup → QR display: shows QR code (evidence: `rino2.py`)
- QR display → Authenticator app: provisions (evidence: `rino2.py`)
- Locker UI → TOTP verification: checks code (evidence: `rino2.py`)
- Locker UI → File encryption: encrypts after verification (evidence: `rino2.py`)
- Locker UI → File decryption: decrypts after verification (evidence: `rino2.py`)
- File encryption → Key derivation: derives key (evidence: `rino2.py`)
- File decryption → Key derivation: derives key (evidence: `rino2.py`)
- File encryption → Local files: reads and writes (evidence: `rino2.py`)
- File decryption → Local files: reads and writes (evidence: `rino2.py`)
- Locker UI → Secure deletion: optionally deletes (evidence: `rino2.py`)
- Secure deletion → Local files: overwrites and removes (evidence: `rino2.py`)
