CryptoWAF — Cryptography-Enhanced Web Application Firewall
Developed as a final project for a Cryptography & Data Security course, CryptoWAF is a security middleware that goes beyond traditional WAFs by combining signature-based threat detection with cryptographic integrity verification on every API request. Built as part of a four-person team.
What I Did
- Designed and implemented a multi-layer Laravel middleware pipeline covering IP blacklisting, API key validation, HMAC signature verification, and pattern-based threat detection
- Built HMAC-SHA256 request signing with constant-time comparison to guarantee request integrity and authenticity
- Implemented cache-based nonce and timestamp validation (±5 minute window) to block replay attacks
- Secured sensitive credentials at rest using AES-256-GCM (AEAD) encryption and Argon2id/BCRYPT password hashing
- Built Regex-based SQL Injection and XSS detectors, plus a brute-force detector with automatic, exponential-backoff IP blacklisting
How It Works
Every incoming request passes through a strict validation pipeline: TLS transport security → IP blacklist check → API key validation → timestamp & nonce verification → HMAC-SHA256 signature check → SQLi/XSS pattern inspection → execution. Any failed check results in immediate rejection and forensic logging to a waf_logs table, which in turn feeds an adaptive defense loop that auto-blocks repeat offenders.
Testing & Results
Validated through simulated SQL Injection, XSS, brute-force, replay, and payload-tampering attacks — all were successfully detected, blocked, and logged with full forensic traceability.
Tech Stack
Laravel 11 (PHP 8.1+) · MySQL 8.0 · OpenSSL (AES-256-GCM, HMAC-SHA256) · Redis/Laravel Cache
Skills Demonstrated
Application Security · Cryptography · API Security · Backend Engineering · System Design · Threat Detection · Forensic Logging


