Skip to content

Nikhil0074-dev/File-Encryption-Decryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Encryption and Decryption System

A security-based application designed to protect sensitive files by converting their contents into an unreadable format using encryption. The encrypted data can only be restored using the correct decryption process.

Project Overview

This project demonstrates concepts such as data security, cryptography basics, algorithm design, and file handling.

Features

  • File Reading: Load and read contents from supported file types (.txt, .csv, .log, .json, .xml, .md)
  • File Encryption: Convert readable plaintext to unreadable ciphertext using Caesar cipher or key-based encryption
  • File Decryption: Restore encrypted data back to its original readable format
  • Save Output: Export processed results to new files

Project Structure

file-encryption-decryption/
├── README.md
├── main.py
├── input/
│   └── sample.txt
├── output/
│   ├── encrypted.txt
│   └── decrypted.txt
├── src/
│   ├── __init__.py
│   ├── file_reader.py
│   ├── encryptor.py
│   ├── decryptor.py
│   └── utils.py
└── tests/
    ├── __init__.py
    └── test_encryption.py

Installation

  1. Ensure you have Python 3.6+ installed
  2. Clone or download this repository
  3. Navigate to the project directory
cd file-encryption-decryption

Usage

Running the Application

Run the main program:

python main.py

Menu Options

  1. Encrypt a file: Select a file and encrypt its contents
  2. Decrypt a file: Select an encrypted file and decrypt it
  3. Run demo: See a demonstration of encryption/decryption
  4. Exit: Quit the application

Encryption Methods

  1. Caesar Cipher: Uses a shift value to encrypt/decrypt (default shift: 3)
  2. Key-based Encryption: Uses a custom key for Vigenère-like cipher

Examples

Caesar Cipher

Original Text: Hello World
Shift: 3
Encrypted: Khoor Zruog

Key-based Encryption

Original Text: Hello World
Key: secret
Encrypted: ZiInc Pgvnu

Running Tests

Run the test suite:

cd tests
python test_encryption.py

Or using unittest:

python -m unittest tests.test_encryption

Module Descriptions

src/file_reader.py

Responsible for reading file content with support for multiple file types.

src/encryptor.py

Handles encryption logic using Caesar cipher algorithm with optional key-based encryption.

src/decryptor.py

Handles decryption logic with support for brute-force decryption.

src/utils.py

Contains helper functions for file operations, validation, and user interface.

Learning Outcomes

By completing this project, you will learn:

  • File input/output operations
  • Basic cryptography concepts
  • Encryption and decryption algorithms
  • Modular programming design
  • Secure data handling techniques

Future Improvements

  • AES encryption algorithm
  • Password-based encryption
  • Graphical user interface (GUI)
  • Support for multiple file formats
  • Cloud-based encrypted storage system

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages