Skip to content

This project is about locking and unlocking files with encryption + access control using Linux system calls in C.

Notifications You must be signed in to change notification settings

vignes-vm/Secure-File-Management-System-with-Encryption-and-Access-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure File Management System with 16 Bit XOR Encryption

Introduction

In today’s digital environment, securing confidential data is a critical requirement for individuals and organizations. The increasing threats of unauthorized access and data breaches make it essential to protect sensitive information even in local file systems. This project — Secure File Management System (SecureFS) — focuses on implementing a lightweight encryption-based file protection mechanism. Instead of complex and resource-heavy cryptographic algorithms, this system employs a 16-bit XOR encryption approach to perform locking and unlocking operations on files.

The goal is to design a simple yet effective file protection mechanism that can restrict direct access to confidential files and enable secure unlocking only when the correct process or user command is executed.

Problem Statement

Traditional file systems store files in plain text or binary formats that can be accessed or modified by anyone with directory permissions. Although modern operating systems provide basic access control, they often lack application-level encryption that provides an extra layer of security. The problem addressed in this project is: "How to prevent unauthorized access to sensitive files by introducing a lightweight encryption-based locking mechanism that is easy to integrate and operate?" The system must:

  • Prevent unauthorized users from reading file content when locked.
  • Provide an unlocking mechanism that restores the file’s original data securely.
  • Maintain minimal processing overhead for simplicity and speed.

Proposed Methodology

Objective

To develop a system that can lock and unlock files using a 16-bit XOR encryption key, thereby preventing unauthorized access to confidential file data.

System Components

  • Encryption Engine: Performs XOR-based encryption and decryption.
  • Lock Module: Encrypts the file content and marks it as inaccessible.
  • Unlock Module: Decrypts the file content and restores its readability.
  • Logging Module: Maintains activity records for each lock/unlock operation.

Working Principle

When a file is locked, the program reads its binary content and performs a bitwise XOR with a 16-bit key. The resulting content becomes unreadable to any text editor or viewer. When unlocking, the same XOR operation is applied again using the same key — since XOR is self-inverse, the original content is perfectly restored.

Mathematical Representation

Let:

P = Plain text bit K = 16-bit key pattern C = Cipher text bit

Then:

Encryption: C = P XOR K
Decryption: P = C XOR K

This duality ensures reversible encryption with a simple operation.

Environment Setup

  • Operating System: macOS / Linux
  • Language Used: C
  • Compiler: GCC (GNU Compiler Collection)

Results and Discussion

The system successfully demonstrated:

  • Secure file locking using XOR encryption.
  • Accurate and lossless file restoration during unlocking.
  • Proper logging for traceability of operations.

Key Observations:

The 16-bit XOR encryption provides moderate security for local storage without noticeable performance lag. Unauthorized access attempts (e.g., using cat or opening with a text editor) fail to reveal meaningful content while locked. Since XOR encryption is symmetric, reapplying the same key restores original data, confirming the correctness of implementation. The system can easily be integrated as a command-line tool for small-scale projects or personal file protection needs.

Limitations:

XOR encryption can be broken by statistical analysis, so it’s not suitable for highly sensitive data. However, for educational and local protection use cases, the solution achieves its intended goal effectively.

Conclusion

The developed Secure File Management System using 16-bit XOR Encryption provides a simple yet efficient mechanism for protecting confidential files. The locking and unlocking process is fast, fully reversible, and easy to operate from the command line.

This project demonstrates the practical application of bitwise encryption for real-world file management scenarios. Although not a substitute for industrial-grade cryptography, it offers a foundation for further development — where modules like AES encryption, access control, or metadata tracking can later be integrated.

About

This project is about locking and unlocking files with encryption + access control using Linux system calls in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •