Skip to content

anabaslabs/cipher

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.

✨ Features

FEATURE DESCRIPTION
Encrypt Secure your text using a custom key. Keeps formatting fully intact.
Decrypt Unlock encrypted text with your key. Recover the original message.
Frequency Analysis Attack Analyze ciphertext patterns automatically. Reveal likely letter substitutions.
Generate Report Compile comparison insights into a clean summary. Export a ready-to-submit report.
Key Generation Auto-generate secure random keys for any supported cipher.

πŸ”‘ 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

πŸ› οΈ Tech Stack

LAYER TECHNOLOGY
Frontend TypeScript, Next.js, Tailwind CSS, shadcn/ui
Shared UI Radix UI, Tabler Icons, Motion
Backend Python, FastAPI, Uvicorn
Monorepo Turborepo, pnpm Workspaces
Deployment Vercel

πŸ—οΈ Project Structure

cipher/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/               # FastAPI backend
β”‚   β”‚   └── app/
β”‚   β”‚       β”œβ”€β”€ routers/   # Cipher logic (encrypt, decrypt, attack, key, report)
β”‚   β”‚       β”œβ”€β”€ routes.py  # API route definitions
β”‚   β”‚       β”œβ”€β”€ config.py  # App configuration
β”‚   β”‚       └── main.py    # FastAPI app entry point
β”‚   └── web/               # Next.js frontend
β”‚       └── app/
|           β”œβ”€β”€ /          # Home page
β”‚           β”œβ”€β”€ encrypt/   # Encryption page
β”‚           β”œβ”€β”€ decrypt/   # Decryption page
β”‚           β”œβ”€β”€ attack/    # Frequency analysis attack page
β”‚           └── report/    # Report generation page
└── packages/
    β”œβ”€β”€ ui/                # Shared UI component library
    β”œβ”€β”€ eslint-config/     # Shared ESLint configuration
    └── typescript-config/ # Shared TypeScript configuration

πŸš€ Getting Started

Prerequisites

  • Node.js >= 20
  • pnpm >= 10
  • Python >= 3.12
  • Turbo CLI (optional)

Setup

Clone the repository and navigate into it:

git clone https://github.com/anabaslabs/cipher.git
cd cipher

Install frontend dependencies (from monorepo root):

pnpm install

Install backend dependencies (from monorepo root):

cd apps/api
py -m venv venv
venv\Scripts\activate # Windows
# OR
source venv/bin/activate # Linux / macOS
pip install -r requirements.txt

Configure environment variables (from monorepo root):

cd apps/api
cp .env.example .env
cd ../../apps/web
cp .env.example .env

Run Locally

Start frontend and backend concurrently (from monorepo root):

pnpm dev
# OR
turbo dev

In Production

Build frontend and backend (from monorepo root):

pnpm build
# OR
turbo build

Start the production server (from monorepo root):

pnpm start
# OR
turbo start

πŸ‘₯ Contributors

saptarshiroy39 itskdhereΒ 

πŸ™‚

About

πŸ”‘ Your all-in-one toolkit for Cipher Project (Monorepo)

Resources

License

Stars

Watchers

Forks

Contributors