Skip to content

saptarshiroy39/Cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cipher Logo
Cipher

Cipher is your all-in-one toolkit for classic cryptography. Built with a Next.js frontend and a FastAPI backend, it lets you Encrypt, Decrypt, run Frequency Analysis Attacks, and generate detailed Reports - all from a clean & modern interface.


🔑 Supported Ciphers

CIPHER KEY TYPE ENCRYPTION / DECRYPTION FREQUENCY ANALYSIS ATTACK
Caesar Cipher Integer Shift ✅ Supported ✅ Supported
Permutation Cipher Permutation Alphabetic ✅ Supported ✅ Supported
Vigenère Cipher Polyalphabetic ✅ Supported ✅ Supported
Playfair Cipher (8x8) Alphanumeric ✅ Supported ❌ Unsupported
Hill Cipher (2x2) Numeric Matrix ✅ Supported ✅ Supported
DES 64 bit Hex ✅ Supported ❌ Unsupported
AES 128/192/256 bit Hex ✅ Supported ⚠️ Impossible
RC5 16/32/64 bit Hex ✅ Supported ⚠️ Impossible

🎯 System Overview

Cipher uses a decoupled architecture with a Next.js frontend and a FastAPI backend, connected over REST with real-time SSE streaming for frequency analysis attacks. All 8 cipher implementations live in modular Python routers, each handling encrypt, decrypt, key generation, and (where applicable) attack logic independently.

Cipher


🏗️ Architecture

# COMPONENT DESCRIPTION STACK
1️⃣ Frontend Pages for encrypt, decrypt, attack & report TypeScript, Next.js, Tailwind CSS, shadcn/ui
2️⃣ Backend REST API handling all cipher operations Python, FastAPI, Uvicorn
3️⃣ Cipher Core Implementations of all 8 supported ciphers Python
4️⃣ Attack Engine Frequency analysis with real-time SSE streaming FastAPI SSE, Python
5️⃣ Report Generates downloadable comparison reports FastAPI, Next.js

📁 Project Structure

Cipher/
├── frontend/               # Next.js frontend
│   ├── app/                # Pages
│   │   ├── page.tsx        # Home
│   │   ├── encrypt/        # Encryption page
│   │   ├── decrypt/        # Decryption page
│   │   ├── attack/         # Frequency analysis attack page
│   │   ├── report/         # Report generation page
│   │   └── layout.tsx      # Root layout
│   ├── components/         # UI components (shadcn) + custom components
│   ├── lib/                # Utilities (cn.ts)
│   ├── hooks/              # Custom React hooks
│   └── public/             # Static assets
├── backend/                # FastAPI backend
│   └── app/
│       ├── main.py         # FastAPI app entry point
│       ├── config.py       # App configuration
│       ├── routes.py       # API route definitions
│       ├── routers/        # Cipher implementations
│       │   ├── caesar/     # Caesar cipher (encrypt, decrypt, attack)
│       │   ├── permute/    # Permutation cipher
│       │   ├── vigenere/   # Vigenère cipher
│       │   ├── playfair/   # Playfair cipher (8x8)
│       │   ├── hill/       # Hill cipher (2x2)
│       │   ├── des/        # DES
│       │   ├── aes/        # AES
│       │   ├── rc5/        # RC5
│       │   └── report.py   # Report generation
│       └── static/         # Static files
├── README.md
└── .gitignore

📖 Instructions

For detailed setup and usage instructions, refer to the respective README files:


Made with 🔑 by Saptarshi Roy & Krishnendu Das

About

A complete toolkit for Cryptography

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors