Skip to content

Repository files navigation

CryptoSuite

Deploy GitHub Pages

CryptoSuite is a browser-based cryptography mathematics calculator for students. It covers modular arithmetic, prime number tools, group theory, number theory algorithms, hash functions, and classical cipher learning tools — all running locally in your browser (no server, no data sent anywhere).

Live demo: https://Spezeeal.github.io/CryptoSuite/


Use without installing (recommended)

You do not need Node.js or npm install to use the app.

Method 1 — GitHub Pages (easiest)

Open the live URL in any modern browser:

https://Spezeeal.github.io/CryptoSuite/

No download, no build, full feature support (including hash tools via HTTPS).

Method 2 — Run locally from the repo (no install required)

After cloning or downloading the ZIP:

For Windows users: Simply double-click the run.bat file, or run it in your Command Prompt.

For Mac/Linux users: Run the run.sh script in your terminal:

bash run.sh

(Alternatively, you can manually open docs/index.html or open.html in your browser).

Method 3 — Local development (contributors)

git clone https://github.com/Spezeeal/CryptoSuite.git
cd CryptoSuite
npm install
npm run dev

Open http://localhost:5173.


Cara pakai tanpa install (Bahasa Indonesia)

Cara Langkah
1 (paling mudah) Buka link GitHub Pages di browser — tidak perlu unduh atau install
2 (Windows) Unduh ZIP repo → ekstrak → klik ganda (double-click) file run.bat, atau jalankan lewat Command Prompt
3 (Mac/Linux) Unduh ZIP repo → ekstrak → buka terminal → jalankan bash run.sh
4 (Dev) Untuk mengembangkan: npm install lalu npm run dev

Catatan browser: Tab hash (SHA) membutuhkan HTTPS atau localhost. Jika membuka file:// langsung, beberapa browser membatasi Web Crypto — gunakan GitHub Pages atau jalankan server lokal singkat, misalnya npx serve docs.


Features

Prime tools

  • List all n-bit primes (n ≤ 20)
  • Generate probable primes (Miller–Rabin)
  • N-th prime (sieve)
  • Trial division primality test
  • Prime factorization

Modular arithmetic

  • Modular exponentiation (square-and-multiply)
  • Modular inverse (extended Euclidean)
  • Discrete log: brute force & baby-step giant-step
  • GCD, modular multiplication

Group theory

  • Generators of Z*_p
  • Order of an element
  • Find one generator for large primes

Number theory

  • Extended Euclidean algorithm (with steps)
  • Euler totient φ(n), Carmichael λ(n)
  • Chinese Remainder Theorem
  • Tonelli–Shanks modular square root
  • Primitive root test
  • Miller–Rabin, Pollard ρ
  • Secure random BigInt, bitwise ops

Hash functions

  • SHA-256, SHA-1 (Web Crypto API)

Learn & classical (cryptanalysis basics)

  • Caesar, Affine, Vigenère, Hill (2×2)
  • XOR repeating key, letter frequency & index of coincidence
  • Hamming distance (hex)
  • RSA toy keygen / encrypt / decrypt (small primes only)

Tech stack

Scripts

Command Description
npm run dev Development server
npm run build GitHub Pages build → dist/ (base: /CryptoSuite/)
npm run build:standalone Standalone build → docs/ (base: ./, for ZIP / file open)
npm run build:all Both Pages and standalone builds
npm run preview Preview Pages build
npm run preview:standalone Preview standalone docs/ build
npm test Run Vitest unit tests

Refreshing docs/ after UI or code changes:

npm run build:standalone

Then commit the updated docs/ folder so download-from-GitHub users get the latest build.

Deploy to GitHub Pages

  1. Create a repository named CryptoSuite on GitHub.
  2. Push this project to main.
  3. In repo Settings → Pages, set source to GitHub Actions.
  4. The workflow in .github/workflows/deploy.yml deploys on every push to main.

Release tags also publish a standalone ZIP via .github/workflows/release-standalone.yml.

Performance limits

Some algorithms are intentionally capped to keep the UI responsive in the browser:

Tool Limit
N-bit prime list n ≤ 20
Brute-force discrete log p ≲ 50,000
RSA toy primes ≤ 4 digits
N-th prime n ≤ 100,000

Project structure

src/
  lib/crypto/     # Pure algorithm modules (testable)
  components/     # UI: tabs, tools, layout
  i18n/           # English / Indonesian strings
docs/             # Pre-built standalone app (open index.html)

License

MIT

About

An interactive browser-based cryptography & number theory calculator built with React 19, TypeScript, and Vite. Designed as an offline-first learning tool for students, featuring classical ciphers, modular arithmetic, prime tools, and group theory.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages