This project is a proof-of-concept Decentralized Cloud Storage System that prioritizes security, privacy, and transparency. It leverages Threshold Cryptography, IPFS, and Blockchain technology to ensure that files are encrypted, their keys are distributed, and their metadata is immutable.
The central philosophy of this project is "Trust No Single Entity". Instead of storing your file and its key on a single server (like traditional cloud storage), this project implements a zero-trust architecture:
- Client-Side Encryption: Files are encrypted before they leave your browser. The server never sees the unencrypted file.
- Shamir's Secret Sharing: The encryption key is never stored intact. It is mathematically split into 5 "shards".
- Distributed Key Management: These shards are distributed across 5 independent nodes (Alpha, Beta, Gamma, Delta, Epsilon). A threshold of 3 shards is required to reconstruct the key.
- Blockchain Verification: Every file upload is recorded on a local Ethereum blockchain (Ganache), providing an immutable proof of existence and ownership.
- IPFS Storage: The encrypted file blob is stored on the InterPlanetary File System (IPFS), ensuring decentralized and content-addressed storage.
- Generation: The client generates a high-entropy AES-256-GCM key.
- Encryption: The file is encrypted locally in the browser using this key.
- Sharding: The key is split into 5 shards using Shamir's Secret Sharing.
- Distribution:
- The Encrypted File is uploaded to IPFS.
- The Key Shards are sent to the backend, which distributes them to available nodes in the network database.
- Blockchain: The backend calls a Smart Contract to store the file's CID, name, and size on the Ethereum blockchain.
- Retrieval: The client fetches the encrypted file from the IPFS Gateawy.
- Shard Gathering: The client requests key shards from the network. It needs at least 3 valid shards.
- Reconstruction: The client mathematically executes the Lagrange Interpolation to reconstruct the original AES key in memory.
- Decryption: The file is decrypted locally and presented to the user.
- Visualization: View the active network topology.
- Simulation: Simulate Node Failures (kill a node) and Node Recoveries.
- Self-Healing: When a node fails, its shards are migrated. When it recovers, the network rebalances load.
- Frontend: React, Vite, Cytoscape.js (Visualization),
secrets.js-grempe(Sharding). - Backend: Node.js, Express,
ethers.js(Blockchain),pg(PostgreSQL). - Database: PostgreSQL (Metadata, Node State, Shards).
- Blockchain: Ganache (Local Ethereum Testnet), Solidity (Smart Contract).
- Storage: IPFS (Local Node).
- Infrastructure: Docker, Docker Compose.
![]() |
![]() |
![]() |
![]() |
- Docker & Docker Compose (Essential)
- Node.js 18+ (For local development scripts)
Launch the database, IPFS node, and Blockchain (Ganache).
docker-compose up -dCreate the tables and seed initial data.
# Set DB URL (Default password: sa_password)
export DATABASE_URL=postgresql://sa_user:sa_password@localhost:5432/storage_db
# Run Migration
node backend/scripts/runMigration.jsDeploy the StorageMetadata contract to the local Ganache blockchain.
node backend/scripts/deployContract.jsThis will update backend/.env with the new Contract Address.
Create a .env file in the backend/ directory:
PORT=4000
# Postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=storage_db
POSTGRES_USER=sa_user
POSTGRES_PASSWORD=sa_password
DATABASE_URL=postgresql://sa_user:sa_password@localhost:5432/storage_db
# JWT
JWT_SECRET=dev_secret_key_change_in_prod
JWT_EXPIRY=7d
BCRYPT_SALT_ROUNDS=12
# Pinata (Placeholders - User needs to fill these or use local IPFS fallback if implemented)
PINATA_API_KEY=
PINATA_API_SECRET=
PINATA_JWT=
# Blockchain (Placeholders)
ETH_PROVIDER_URL=http://127.0.0.1:7545
CONTRACT_ADDRESS=0x9DE9028f3165d5ac05D8d0Bb5C81E5fe025b4Dd4
CONTRACT_PRIVATE_KEY=Backend API (Port 4000)
cd backend
npm install
npm startFrontend App (Port 5173)
cd frontend
npm install
npm run dev- Register/Login: Create an account.
- Upload: Select a file, check "Enable Threshold Encryption", and upload.
- My Files: Click a file to view details.
- Decrypt: Click "Reconstruct Key & Decrypt" to download your file.
- Node Topology: Visualize the 5-node cluster.
- Click "Kill Node" to simulate failure (watch shards migrate in logs).
- Click "Recover Node" to bring it back (watch load rebalancing).
- Blockchain Monitor: Switch tabs to view real-time Blockchain stats (Block Height, Gas Price, Transaction Ledger).
"Decryption Failed"
- Ensure your IPFS node allows CORS (The setup script handles this).
- Ensure you are using
http://localhost:5173to access the app.
Blockchain Connection Error
- Check if Ganache is running:
docker ps. - If you restarted Ganache, you MUST redeploy the contract (
node backend/scripts/deployContract.js).



