Skip to content

alinmasih/Cryptography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABE: Public-Key Cryptography - A Hybrid Approach Using Polybius and Vigenere Cipher

A secure cryptographic system that combines classical ciphers (Polybius and Vigenere) with Ciphertext-Policy Attribute-Based Access Control (CP-ABAC). This system ensures that data is encrypted using a hybrid approach and can only be decrypted by users whose attributes satisfy a specific access policy.

🚀 Project Overview

This project is a full-stack application designed to demonstrate a multi-layered encryption process:

  1. Polybius Square Cipher: Initial transformation of the plaintext.
  2. Vigenère Cipher: Secondary encryption using a secret key.
  3. Attribute-Based Access Control: Implementation of access policies that govern who can decrypt the final ciphertext.

🛠️ Tech Stack

  • Frontend: React.js, Vite, Lucide Icons, Vanilla CSS
  • Backend: Node.js, Express.js
  • Tooling: NPM Workspaces

🚦 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm (v9 or higher)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd ABE
  2. Install dependencies for both frontend and backend from the root:

    npm install

Running the Application

You can run both parts from the root directory using the following scripts:

  • Frontend (Dev):

     npm run dev:frontend
  • Backend (Dev):

     npm run dev:backend

Frontend API Configuration

The frontend reads backend URL from VITE_API_BASE_URL.

  1. Create frontend/.env (or copy from frontend/.env.example)
  2. Set:
    VITE_API_BASE_URL=http://localhost:5001

🔐 Cryptography Workflow

  1. Plaintext Input: The user provides the message to be encrypted.
  2. Policy Definition: An access policy is assigned (e.g., role: "admin", department: "security").
  3. Hybrid Encryption:
    • The message is first processed via a Polybius Square.
  • The result is then encrypted using the Vigenere Cipher with a user-provided secret key.
  • The Vigenere stage transforms printable ASCII data, so special characters in the encrypted stream are also protected.
  1. Decryption & Access:
    • A receiver must provide the correct secret key.
    • The receiver's attributes must match the policy embedded in the encryption for successful decryption.

About

ABE: Public Key Cryptography — A Hybrid Approach using Polybius & Vigenère Cipher

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors