Skip to content

mridulr2003/File-Encryption-Decryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Encryption and Decryption

Overview

This project implements a file encryption and decryption system using parallel processing techniques in C++. The application can encrypt or decrypt all files in a specified directory using efficient cryptographic algorithms and parallel processing for improved performance.

Features

  • File Processing: Encrypt or decrypt entire directories of files
  • Parallel Processing: Utilizes parallel processing for handling multiple files efficiently
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Modular Design: Clean separation of concerns with dedicated modules for:
    • Encryption/Decryption operations
    • File I/O handling
    • Process management
    • Environment configuration

Project Structure

├── main.cpp                           # Main application entry point
├── Makefile                          # Build configuration for Unix-like systems
├── build.bat                         # Windows batch build script
├── build.ps1                         # PowerShell build script
├── src/
│   └── app/
│       ├── encryptDecrypt/
│       │   ├── Cryption.cpp          # Encryption/decryption implementation
│       │   ├── Cryption.hpp          # Encryption/decryption headers
│       │   └── CryptionMain.cpp      # Standalone cryption utility
│       ├── fileHandling/
│       │   ├── IO.cpp                # File input/output operations
│       │   ├── IO.hpp                # File I/O headers
│       │   ├── ReadEnv.cpp           # Environment configuration reader
│       │   └── ReadEnv.hpp           # Environment headers
│       └── processes/
│           ├── ProcessManagement.cpp  # Process and task management
│           ├── ProcessManagement.hpp  # Process management headers
│           └── Task.hpp              # Task definition structures
└── test/
    ├── test1.txt                     # Sample test files
    └── test2.txt

Prerequisites

  • C++ Compiler: g++ with C++17 support
  • Build Tools:
    • Linux/macOS: make (usually pre-installed)
    • Windows: Either install make via MinGW/MSYS2 or use provided batch scripts

Getting Started

Method 1: Using Make (Linux/macOS/Windows with make installed)

# Clone the repository
git clone https://github.com/mridulr2003/File-Encryption-Decryption.git
cd File-Encryption-Decryption

# Build the project
make

# Run the application
./encrypt_decrypt        # Linux/macOS
# or
encrypt_decrypt.exe      # Windows

Method 2: Using Windows Build Scripts

# Clone the repository
git clone https://github.com/mridulr2003/File-Encryption-Decryption.git
cd File-Encryption-Decryption

# Build using batch script
build.bat

# Or build using PowerShell script
# build.ps1

# Run the application
encrypt_decrypt.exe

Method 3: Manual Compilation

If you prefer to compile manually or troubleshoot build issues:

# Compile source files
g++ -std=c++17 -g -Wall -I. -Isrc/app/encryptDecrypt -Isrc/app/fileHandling -Isrc/app/processes -c main.cpp -o main.o
g++ -std=c++17 -g -Wall -I. -Isrc/app/encryptDecrypt -Isrc/app/fileHandling -Isrc/app/processes -c src/app/processes/ProcessManagement.cpp -o src/app/processes/ProcessManagement.o
g++ -std=c++17 -g -Wall -I. -Isrc/app/encryptDecrypt -Isrc/app/fileHandling -Isrc/app/processes -c src/app/fileHandling/IO.cpp -o src/app/fileHandling/IO.o
g++ -std=c++17 -g -Wall -I. -Isrc/app/encryptDecrypt -Isrc/app/fileHandling -Isrc/app/processes -c src/app/fileHandling/ReadEnv.cpp -o src/app/fileHandling/ReadEnv.o
g++ -std=c++17 -g -Wall -I. -Isrc/app/encryptDecrypt -Isrc/app/fileHandling -Isrc/app/processes -c src/app/encryptDecrypt/Cryption.cpp -o src/app/encryptDecrypt/Cryption.o

# Link executable
g++ -std=c++17 -g -Wall main.o src/app/processes/ProcessManagement.o src/app/fileHandling/IO.o src/app/fileHandling/ReadEnv.o src/app/encryptDecrypt/Cryption.o -o encrypt_decrypt

Usage

  1. Run the application:

    ./encrypt_decrypt        # Linux/macOS
    encrypt_decrypt.exe      # Windows
  2. Enter directory path:

    • Provide the full path to the directory containing files you want to encrypt/decrypt
    • Example: C:\Users\YourName\Documents\TestFiles (Windows)
    • Example: /home/username/testfiles (Linux)
  3. Choose action:

    • Type encrypt to encrypt all files in the directory
    • Type decrypt to decrypt all files in the directory
  4. Processing:

    • The application will process all files in parallel
    • Encrypted/decrypted files will be saved with appropriate modifications
    • Progress and status information will be displayed

Clean Build

To clean build artifacts:

# Using make
make clean

# Manual cleanup (Windows)
del *.o src\app\encryptDecrypt\*.o src\app\fileHandling\*.o src\app\processes\*.o encrypt_decrypt.exe

# Manual cleanup (Linux/macOS)
rm -f *.o src/app/encryptDecrypt/*.o src/app/fileHandling/*.o src/app/processes/*.o encrypt_decrypt

About

Encrypt and decrypt files using well known algorithms in C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published