This project demonstrates a simple file encryption process using C and a shell script. The project allows you to encrypt multiple files stored in a directory and save the encrypted files in a separate directory.
- File Encryption: Encrypts files using a simple XOR-based encryption algorithm.
- Directory Management: Automatically checks and manages the input (upload) and output (encrypted) directories.
- Error Handling: Provides robust error handling for missing directories, empty directories, and file access issues.
crypto-encryption-project/
├── README.md
├── LICENSE
├── encrypt.c
├── encrypt_files.sh
├── upload/
│ ├── example.txt
├── encrypted/ # Directory where encrypted files are saved (created by script)
└── .gitignore
- GCC : To compile the C program.
- Bash : To run the shell script.
1. Clone the Repository :
git clone https://github.com/techiuv/crypto-encryption-project.git
cd crypto-encryption-project
2. Compile the C Program :
gcc -o encrypt encrypt.c
3. Prepare Files for Encryption :
Place the files you want to encrypt into the upload/ directory
. Example file (example.txt
) is already provided.
4. Run the Shell Script :
./encrypt_files.sh
The script will:
Check if the upload directory
exists and contains files.
Create the encrypted directory
if it doesn’t exist.
Encrypt each file in the upload directory
and save the encrypted files
in the encrypted directory
.
5. Check Encrypted Files
After running the script, you can find the encrypted files in the encrypted/ directory.
6. Customization
You can change the encryption key by editing the ENCRYPTION_KEY variable in the encrypt_files.sh
script.
The script and C program handle various errors, including:
- Missing or unreadable directories.
- Files that cannot be read or written.
- General encryption failures.
This project is licensed under the MIT License
. You are free to use, modify, and distribute this software in your own projects.
Contributions are welcome! Please fork this repository and submit a pull request with your changes.
- Features: Summarizes what the project does.
- Project Structure: Shows how files and directories are organized.
- Requirements: Lists the necessary software.
- Setup and Usage: Provides step-by-step instructions on how to set up and use the project.
- Error Handling: Briefly mentions how errors are managed.
- License: Specifies the licensing terms.
- Contributions: Invites others to contribute to the project.
- Contact: Provides ways for users to get in touch or report issues.
This README.md
file should provide all necessary information for users and contributors to understand and use your project effectively.