This project demonstrates a secure way to store and retrieve files using AES for fast encryption and RSA for secure key handling. It uses:
- Azure Blob Storage for storing encrypted files,
- Azure Key Vault for RSA key management,
- Streamlit for frontend,
- Flask for backend APIs.
.
├── app/
│ ├── main.py # Flask backend
│ ├── front.py # Streamlit frontend
│ ├── encryption.py # AES encrypt/decrypt logic
│ ├── key_vault.py # RSA key handling + secrets
│ ├── database.py # Store encrypted AES key
│ ├── storage.py # Azure blob helper (optional)
│ ├── swagger.yaml # API docs
│ ├── downloads/ # Downloads folder (volume mounted)
├── Dockerfile
├── requirements.txt
├── .env # Secrets like key vault name, etc.
└── README.md
- Python 3.10+
- Azure subscription
- Azure CLI (logged in:
az login) - Docker installed
git clone https://github.com/rohitarodi/SecureFileStorageApp
cd secure-file-storage
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtAZURE_KEY_VAULT_NAME=kv-yourvault
AZURE_RSA_KEY_NAME=rsa-encryption-key
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=...
AZURE_STORAGE_CONTAINER=file-storage
COSMOS_MONGO_CONNECTION_STRING=your-mongo-uri (optional)
ENCRYPTION_KEY=optional-default-key
cd app
python main.pyIn another terminal:
cd app
streamlit run front.pyOpen:
http://localhost:8501
docker build -t secure-file-storage-app .docker run -d -p 5000:5000 -p 8501:8501 \
--env-file .env \
-v "${PWD}/DownloadsFromDocker:/app/downloads" \
--name secure-storage-container \
secure-file-storage-app- Flask:
http://localhost:5000 - Streamlit:
http://localhost:8501
az acr create --resource-group your-rg --name youracrname --sku Basic
az acr login --name youracrnamedocker tag secure-file-storage-app youracrname.azurecr.io/secure-file-storage-app:latest
docker push youracrname.azurecr.io/secure-file-storage-app:latestaz appservice plan create --name your-app-plan --resource-group your-rg --is-linux
az webapp create --resource-group your-rg \
--plan your-app-plan \
--name your-app-name \
--deployment-container-image-name youracrname.azurecr.io/secure-file-storage-app:latest \
--registry-login-server youracrname.azurecr.io \
--registry-username <acr-username> \
--registry-password <acr-password>