Skip to content

About

SecureFile is a web-based cybersecurity tool for encrypting and decrypting files securely. It uses AES-256-GCM encryption with password-based key derivation to protect sensitive data. Users can upload files, encrypt them, download encrypted copies, and decrypt them using the correct password without storing their files permanently.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🔐 SecureFile – File Encryption & Decryption Tool

SecureFile is a web-based cybersecurity application that allows users to securely encrypt and decrypt files using modern cryptographic techniques.

The application uses AES-256-GCM encryption and PBKDF2-HMAC-SHA256 for secure password-based key derivation.

Users can encrypt a file with a password, download the encrypted file, and later decrypt it using the same password.


🚀 Features

🔒 File Encryption

  • Upload any supported file.
  • Enter a password.
  • Encrypt the file using AES-256-GCM.
  • Download the encrypted file.
  • The original file remains unchanged.

🔓 File Decryption

  • Upload an encrypted .enc file.
  • Enter the original password.
  • Decrypt the file.
  • Download the original file.

🛡️ Security

  • AES-256-GCM authenticated encryption.
  • PBKDF2-HMAC-SHA256 for password-based key derivation.
  • Random salt for every encryption operation.
  • Random IV/nonce for every encryption operation.
  • Passwords are never stored.
  • Uploaded files are not permanently stored.
  • Modified or corrupted encrypted files are rejected.

🚫 Encrypted File Protection

SecureFile prevents users from encrypting an already encrypted SecureFile file.

document.pdf
      ↓
   Encrypt
      ↓
document.pdf.enc

Trying to encrypt the .enc file again will result in:

❌ File is already encrypted

🧠 How It Works

Encryption

Original File
     ↓
User Password
     ↓
PBKDF2-HMAC-SHA256
     ↓
Encryption Key
     ↓
AES-256-GCM
     ↓
Encrypted File (.enc)

Decryption

Encrypted File (.enc)
     ↓
User Password
     ↓
PBKDF2-HMAC-SHA256
     ↓
Encryption Key
     ↓
AES-256-GCM
     ↓
Original File

🔐 Why AES-256-GCM?

AES (Advanced Encryption Standard) is a widely used symmetric encryption algorithm.

SecureFile uses AES-256-GCM because it provides:

  • Strong encryption
  • Confidentiality
  • Integrity protection
  • Authentication of encrypted data

GCM also helps detect if an encrypted file has been modified or corrupted.


🔑 Password Security

The user's password is not directly used as the AES encryption key.

Instead:

Password
   +
Random Salt
   ↓
PBKDF2-HMAC-SHA256
   ↓
256-bit Encryption Key

This makes password-based encryption significantly stronger than directly using the password as an encryption key.

The password is never stored by the application.


📁 Encrypted File Format

SecureFile stores the required cryptographic information inside the encrypted file.

Conceptually:

┌──────────────────────┐
│ SecureFile Header    │
├──────────────────────┤
│ Version              │
├──────────────────────┤
│ Random Salt          │
├──────────────────────┤
│ Random IV / Nonce    │
├──────────────────────┤
│ Encrypted File Data  │
├──────────────────────┤
│ Authentication Tag   │
└──────────────────────┘

The password is not stored inside the file.

Without the correct password, the encrypted file cannot be successfully decrypted.


🖥️ User Workflow

Encrypt a File

  1. Open SecureFile.
  2. Select Encrypt.
  3. Choose a file.
  4. Enter a password.
  5. Click Encrypt File.
  6. Download the .enc file.

Decrypt a File

  1. Select Decrypt.
  2. Choose the encrypted .enc file.
  3. Enter the same password used during encryption.
  4. Click Decrypt File.
  5. Download the restored file.

🚫 Invalid Operations

SecureFile prevents common invalid operations.

Encrypting an already encrypted file

document.pdf.enc
       ↓
     Encrypt
       ↓
❌ Already encrypted

Using the wrong password

Encrypted File
      ↓
Wrong Password
      ↓
❌ Decryption Failed

Modified encrypted file

If the encrypted file is modified after encryption:

Encrypted File
      ↓
Modified / Corrupted
      ↓
AES-GCM Verification
      ↓
❌ Integrity Check Failed

🛠️ Technologies Used

Backend

  • Java
  • Spring Boot
  • Spring Web
  • Java Cryptography Architecture (JCA)

Cryptography

  • AES-256-GCM
  • PBKDF2-HMAC-SHA256
  • SecureRandom

Frontend

  • HTML5
  • CSS3
  • JavaScript

Deployment

  • Docker
  • GitHub
  • Cloud deployment

📂 Project Structure

SecureFile/
│
├── src/
│   └── main/
│       ├── java/
│       │   └── com/
│       │       └── securefile/
│       │           ├── controller/
│       │           ├── service/
│       │           ├── security/
│       │           ├── config/
│       │           └── SecureFileApplication.java
│       │
│       └── resources/
│           ├── static/
│           │   ├── index.html
│           │   ├── css/
│           │   └── js/
│           │
│           └── application.properties
│
├── Dockerfile
├── .gitignore
├── pom.xml
└── README.md

⚙️ Running Locally

Prerequisites

Make sure you have:

  • Java 17 or later
  • Maven
  • Git

Clone the repository

git clone <YOUR-GITHUB-REPOSITORY>

Navigate into the project

cd SecureFile

Run the application

mvn spring-boot:run

The application will start locally.

Open:

http://localhost:8080

🐳 Running with Docker

Build the Docker image:

docker build -t securefile .

Run the container:

docker run -p 8080:8080 securefile

Then open:

http://localhost:8080

🌐 Public Deployment

SecureFile can be deployed as a public web application.

Recommended architecture:

GitHub
   ↓
Docker
   ↓
Cloud Platform
   ↓
Public URL
   ↓
Anyone can access SecureFile

No account or login is required.

Users only need a web browser.


🔒 Security Considerations

SecureFile is designed as an educational cybersecurity project and follows important security principles:

  • Strong authenticated encryption
  • Random cryptographic salt
  • Random IV/nonce
  • Password-based key derivation
  • No password storage
  • No permanent file storage
  • File validation
  • Protection against repeated encryption
  • Integrity verification using AES-GCM
  • Safe error handling
  • No sensitive information in error responses

Important

The security of the encrypted file ultimately depends on the strength of the password chosen by the user.

Users should use strong, unique passwords.


🎯 Project Objectives

The main objectives of SecureFile are:

  1. Demonstrate practical use of cryptography.
  2. Understand symmetric encryption.
  3. Learn how AES works in real applications.
  4. Understand password-based key derivation.
  5. Demonstrate file confidentiality.
  6. Demonstrate file integrity verification.
  7. Build a practical cybersecurity application.
  8. Provide a simple interface that non-technical users can understand.

🎓 Academic Use

SecureFile can be used as a college cybersecurity project to demonstrate concepts such as:

  • Cryptography
  • Symmetric encryption
  • AES
  • Password-based encryption
  • Key derivation
  • Authentication
  • Data confidentiality
  • Data integrity
  • Secure file handling

🔮 Future Enhancements

Possible future improvements include:

  • Multiple file encryption
  • Folder encryption
  • Password strength meter
  • Secure file sharing
  • Expiring download links
  • Client-side encryption
  • Cloud storage integration
  • User accounts
  • File integrity verification
  • Encryption history
  • QR-based secure file sharing

👨‍💻 Author

Godson Suresh

Cybersecurity / Computer Science Project


📜 License

This project is intended primarily for educational and academic purposes.

Add an appropriate open-source license if you plan to distribute the project publicly.

About

SecureFile is a web-based cybersecurity tool for encrypting and decrypting files securely. It uses AES-256-GCM encryption with password-based key derivation to protect sensitive data. Users can upload files, encrypt them, download encrypted copies, and decrypt them using the correct password without storing their files permanently.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages