# kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection architecture

> Architecture diagram of the GitHub repository kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection
- Repository: https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection

## Overview

Secure File Handling System is a Flask application for authenticated file upload, malware screening, encryption, cloud storage, sharing, and controlled download/decryption. Its main workflow is coordinated by app.py: an upload is scanned, encrypted, stored in Cloudinary, and associated with an on-chain key and local file metadata; download checks access and the supplied key before retrieving and decrypting the file. The graph also preserves registration and sharing, plus the separate AES helper and smart-contract capability. Source excerpts show only part of the routes, so unsampled route details are represented only where README documentation supports them.

Main entry points: [`app.py`](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py) (Flask routes), [`model.py`](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/model.py) (Malware prediction), [`blockchain.py`](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/blockchain.py) (Blockchain key client), [`templates`](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/tree/main/templates) (Web pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask routes<br/>[app.py]"]
  node_templates["Web pages"]
end

subgraph group_security["File security"]
  node_malware["Malware prediction<br/>[model.py]"]
  node_features["PE feature extraction"]
  node_aes["AES helper<br/>[aes.py]"]
  node_encryption["File encryption<br/>[app.py]"]
end

subgraph group_storage["File and key storage"]
  node_cloud[("Cloudinary files")]
  node_database[("Local file and user data<br/>[app.py]")]
  node_key_service["Blockchain key client<br/>[blockchain.py]"]
  node_contract["Key storage contract<br/>[KeyStorage.sol]"]
end

subgraph group_identity["Identity and sharing"]
  node_accounts["Accounts and sessions<br/>[app.py]"]
  node_sharing["File sharing<br/>[app.py]"]
end

node_user(("User"))
node_ethereum["Ethereum network"]

node_user -->|"uses routes"| node_flask
node_flask -->|"renders pages"| node_templates
node_flask -->|"handles login"| node_accounts
node_flask -->|"scans upload"| node_malware
node_malware -->|"extracts features"| node_features
node_flask -->|"encrypts and decrypts"| node_encryption
node_flask -->|"uploads and fetches"| node_cloud
node_flask -->|"stores and retrieves keys"| node_key_service
node_key_service -->|"calls contract"| node_ethereum
node_ethereum -.->|"executes key operations"| node_contract
node_flask -->|"reads and writes records"| node_database
node_flask -->|"manages shares"| node_sharing
node_sharing -->|"stores share records"| node_database

click node_flask "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py"
click node_templates "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/tree/main/templates"
click node_accounts "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py"
click node_sharing "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py"
click node_malware "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/model.py"
click node_features "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/feature_extraction.py"
click node_aes "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/aes.py"
click node_encryption "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py"
click node_database "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py"
click node_key_service "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/blockchain.py"
click node_contract "https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/contracts/KeyStorage.sol"

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_flask,node_templates,node_user toneBlue
class node_malware,node_features,node_aes,node_encryption toneAmber
class node_cloud,node_database,node_key_service,node_contract toneMint
class node_accounts,node_sharing toneRose
class node_ethereum toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py): `app.py`
- [Web pages](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/tree/main/templates): `templates`

### File security

- [Malware prediction](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/model.py): `model.py`
- [PE feature extraction](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/feature_extraction.py): `feature_extraction.py`
- [AES helper](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/aes.py): `aes.py`
- [File encryption](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py): `app.py`

### File and key storage

- **Cloudinary files**
- [Local file and user data](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py): `app.py`
- [Blockchain key client](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/blockchain.py): `blockchain.py`
- [Key storage contract](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/contracts/KeyStorage.sol): `contracts/KeyStorage.sol`

### Identity and sharing

- [Accounts and sessions](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py): `app.py`
- [File sharing](https://github.com/kumarjitdron/secure-file-storage-in-cloud-using-aes-encryption-and-blockchain-key-management-malware-detection/blob/main/app.py): `app.py`

### Other components

- **User**
- **Ethereum network**

## Connections

- User → Flask routes: uses routes (evidence: `app.py`)
- Flask routes → Web pages: renders pages (evidence: `app.py`)
- Flask routes → Accounts and sessions: handles login (evidence: `app.py`)
- Flask routes → Malware prediction: scans upload (evidence: `app.py`)
- Malware prediction → PE feature extraction: extracts features (evidence: `model.py`)
- Flask routes → File encryption: encrypts and decrypts (evidence: `app.py`)
- Flask routes → Cloudinary files: uploads and fetches (evidence: `app.py`)
- Flask routes → Blockchain key client: stores and retrieves keys (evidence: `app.py`)
- Blockchain key client → Ethereum network: calls contract (evidence: `blockchain.py`)
- Ethereum network → Key storage contract: executes key operations (evidence: `README.md`)
- Flask routes → Local file and user data: reads and writes records (evidence: `app.py`)
- Flask routes → File sharing: manages shares (evidence: `app.py`)
- File sharing → Local file and user data: stores share records (evidence: `app.py`)
