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.
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.
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.
- 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.
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.
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.
- Operating System: macOS / Linux
- Language Used: C
- Compiler: GCC (GNU Compiler Collection)
The system successfully demonstrated:
- Secure file locking using XOR encryption.
- Accurate and lossless file restoration during unlocking.
- Proper logging for traceability of operations.
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.
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.
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.