Skip to content

harsh-kumar-005/SecureVault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecureVault — Concurrent Multi-User File Vault

A networked file storage system where multiple clients connect to a central server to upload, download, lock, and manage files — with role-based permissions. Think of it as a mini Google Drive with OS-level security.

OS Concepts Implemented

# Concept Implementation
1 Role-Based Authorization 3 roles (Admin/User/Guest) with different access levels
2 File Locking flock() — shared locks for reads, exclusive locks for writes
3 Concurrency Control pthread per client, semaphore limits max connections, mutex for shared data
4 Data Consistency Mutex-protected shared state, file locks prevent lost updates
5 Socket Programming TCP client-server with structured message protocol
6 IPC Named pipe (server → logger) + Shared memory (server → dashboard)

Project Structure

SecureVault/
├── common.h      — Shared definitions, protocol, role enums
├── server.c      — Main server: sockets, threads, file operations, IPC
├── client.c      — Interactive CLI client
├── logger.c      — Audit logger process (IPC via named pipe)
├── dashboard.c   — Real-time stats (IPC via shared memory)
├── Makefile      — Build system
├── data/
│   └── users.txt — User credentials & roles
├── vault/        — Stored files (created at runtime)
└── logs/
    └── audit.log — Audit trail

How to Build

make all

This compiles 4 binaries: server, client, logger, dashboard.

How to Run

You need 4 terminal windows (or use & for background):

Terminal 1 — Start the Server

./server

Terminal 2 — Start the Logger (optional, demonstrates IPC)

./logger

Terminal 3 — Start the Dashboard (optional, demonstrates IPC)

./dashboard

Terminal 4 — Start a Client

./client

Test Accounts

Username Password Role Permissions
admin admin123 ADMIN Full access — upload, download, list all, delete any
alice pass123 USER Own files — upload, download, list own, delete own
bob pass456 USER Own files — upload, download, list own, delete own
guest guest GUEST Read-only — list all, download any file

Features

  • Multi-client support — Multiple users can connect simultaneously
  • Role-based access control — Each role has specific permissions
  • File locking — Prevents data corruption during concurrent access
  • Audit logging — All operations logged via IPC named pipe
  • Live dashboard — Real-time stats via IPC shared memory
  • Graceful shutdown — Clean cleanup on Ctrl+C

Technologies Used

  • Language: C (compiled with GCC)
  • Threading: POSIX threads (pthread)
  • Synchronization: Mutex, Semaphore
  • File Locking: flock() advisory locking
  • Networking: BSD Sockets (TCP)
  • IPC: Named Pipes (FIFO), Shared Memory (System V)

Author

EGC 301P — Operating Systems Lab Mini Project

About

Concurrent Multi-User File Vault

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors