Skip to content

yasser-rafid/Rabin-Image-Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rabin Image Encryption

This Django project demonstrates the implementation of Rabin encryption for image files. The repository provides a simple web interface to encrypt images using the Rabin encryption algorithm.

Installation Guide

Follow the steps below to set up the project on your local machine.

Prerequisites

  • Python 3.8 or later
  • pip (Python package manager)
  • Git (to clone the repository)

Installation Steps

Clone the Repository

Open your terminal or command prompt and run:

git clone https://github.com/yasser-rafid/Rabin-Image-Encryption.git
cd Rabin-Image-Encryption

Create a Virtual Environment

It is recommended to use a virtual environment to manage dependencies. Create and activate a virtual environment:

python -m venv env

# On Windows
.\env\Scripts\activate

# On macOS/Linux
source env/bin/activate

Install Dependencies

Install the required Python packages listed in the requirements.txt file:

pip install -r requirements.txt

Set Up the Database

The project uses SQLite as the default database. Run the following commands to create and apply migrations:

python manage.py migrate

Create a Superuser (Admin)

To access the admin panel and manage users, create a superuser:

python manage.py createsuperuser

Follow the prompts to enter a username, email, and password. This will create an admin user.

Run the Development Server

Start the Django development server to test the application:

python manage.py runserver

Open your web browser and navigate to http://127.0.0.1:8000 to view the application.

Features

  • Encrypt images using the Rabin encryption algorithm.
  • User Authentication: Users can register, log in, and submit their profile information.
  • Admin Panel: Admins can manage users and their profiles.
  • Simple and intuitive web interface.

User Roles

Regular User

  • Can register and log in.
  • Can submit their profile information (full name, phone number, city, university, department, graduation year, and personal image).
  • After submitting their profile, they see a confirmation message instructing them to visit the university to get their paper.

Admin User

  • Can log in to the admin panel (http://127.0.0.1:8000/admin).
  • Can view and manage all user profiles.
  • Has access to additional administrative features.

Database

The project uses SQLite as the default database. The database file (db.sqlite3) is automatically created when you run migrations. It stores:

  • User information (regular users and admins).
  • User profile data.
  • Encrypted and decrypted image metadata.

Notes

  • Ensure that your Python version matches the required version mentioned in the prerequisites.
  • The db.sqlite3 file is excluded from the repository (via .gitignore) as it contains local data.
  • For production, consider using a more robust database like PostgreSQL or MySQL.

How to Create an Admin User

Run the following command:

python manage.py createsuperuser

Enter a username, email, and password when prompted.

Log in to the admin panel at http://127.0.0.1:8000/admin using the credentials you just created.

Difference Between Regular Users and Admins

Feature Regular User Admin User
Registration Can register and log in Cannot register; must be created via createsuperuser
Profile Submission Can submit profile information Cannot submit profile information
Admin Panel Access No access Full access to manage users and profiles
Permissions Limited to personal profile Can view and manage all user data

License

This project is licensed under the MIT License. This project was developed by Yasser Rafid, Abdullah Saad, and Haider Bassim.