A web application implementing RSA (asymmetric) and AES (symmetric) cryptographic algorithms from scratch in pure Python, with a Flask REST API and a React + Tailwind frontend. Includes RSA digital signatures with SHA-256, Miller-Rabin primality testing, and full AES-128/192/256 with custom S-box, ShiftRows, and MixColumns.
Overview
Modern Cryptography (RSA & AES) is a web application built for CSCI 663 (Introduction to Cryptography) that implements both RSA (asymmetric) and AES (symmetric) encryption algorithms from scratch in pure Python, exposed through a Flask REST API with an interactive React frontend.
The Problem
Cryptography is easy to use as a black box via libraries like OpenSSL, but that hides how the underlying algorithms actually work. For a course focused on understanding cryptographic primitives, the assignment called for implementing RSA and AES from first principles rather than wrapping an existing library, then making the internals visible and interactive rather than just passing unit tests.
The Solution
The project implements both algorithms from scratch and wraps them in a shared API and UI so the algorithms can be exercised and compared interactively.
- RSA from Scratch includes asymmetric encryption/decryption, digital signatures with SHA-256 hashing and verification, Miller-Rabin primality testing, and the Extended Euclidean Algorithm for modular inverse, supporting 256 to 2048-bit keys.
- AES from Scratch implements AES-128/192/256 in ECB mode with PKCS#7 padding, including a custom S-box, ShiftRows, and MixColumns implementation rather than relying on a crypto library.
- Unified Flask REST API serves both RSA and AES through a single server with session management for RSA keys and CORS enabled for the frontend.
- Interactive React Frontend lets users switch between algorithms, generate keys, encrypt/decrypt text, and copy results, with Tailwind CSS for styling.
- Performance Benchmarking measures and visualizes generation, encryption, and decryption times across key sizes for both algorithms.
My Contributions
This was a group project for CSCI 663 (Group B). I contributed to the cryptographic implementation and the application layer connecting the RSA and AES modules to the Flask API and React frontend, working alongside two teammates on the overall system.
