A decentralized Key Management System built as a Cryptography & Network Security college project. Uses Ethereum smart contracts for lifecycle management, IPFS for encrypted storage, and browser-side AES-256-GCM encryption.
🌐 Live App: key-management-system-blockchain.vercel.app
📜 Verified Contract: View on Etherscan
Browser (React MVVM)
├── AES-256-GCM encryption (Web Crypto API)
├── IPFS upload/fetch (Pinata)
└── Smart contract calls (ethers.js + MetaMask)
│
├── Ethereum Sepolia ──► KeyLifecycleManager.sol
│ • registerKey / rotateKey / revokeKey
│ • Events → immutable audit trail
└── IPFS (Pinata) ──────► Encrypted key blobs
- Node.js 18+ — nodejs.org
- MetaMask — browser extension with a Sepolia wallet
- Sepolia ETH — from sepoliafaucet.com
- Alchemy account — free Sepolia RPC URL
- Pinata account — free IPFS API JWT
- Etherscan API key — for contract verification
# Root (smart contracts)
npm install
# Frontend
cd frontend
npm installcp .env.example .env
# Edit .env with your keys (see .env.example for details)npx hardhat compile
npx hardhat testnpx hardhat run scripts/deploy.js --network sepoliaThis writes the contract address and ABI to frontend/src/constants/.
cd frontend
npm run devOpen http://localhost:5173, connect MetaMask, and start managing keys!
| Feature | Description |
|---|---|
| Register Key | Generate → encrypt → upload to IPFS → on-chain record |
| Rotate Key | New encrypted key → new IPFS CID → on-chain update |
| Revoke Key | Irreversible on-chain state change |
| Audit Trail | Event timeline from blockchain (Etherscan links) |
blockchain-kms/
├── contracts/
│ └── KeyLifecycleManager.sol # Solidity smart contract
├── test/
│ └── KeyLifecycleManager.test.js# Hardhat tests
├── scripts/
│ └── deploy.js # Deployment + ABI export
├── frontend/
│ └── src/
│ ├── models/ # Data classes
│ ├── viewmodels/ # Business logic (useReducer)
│ ├── services/ # Encryption, IPFS, Web3
│ ├── views/ # React UI components
│ └── constants/ # ABI, address, config
├── hardhat.config.js
├── .env.example
└── README.md
- Solidity 0.8.20 + OpenZeppelin
- Hardhat — compile, test, deploy
- React 18 + Vite — MVVM frontend
- ethers.js v6 — blockchain interaction
- Web Crypto API — AES-256-GCM encryption
- Pinata — IPFS uploads (free tier)
- Sepolia Testnet — zero-cost deployment
MIT