Skip to content

watford-ep/seng-401-practical-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SENG 401 - Practical Crypto — Companion Repo

This repository contains companion code and examples for the SENG 401 "Practical Crypto" lecture. It includes three small demo projects that show different ways to implement and validate common authentication schemes (API keys, HTTP Basic, JWT, HMAC signatures, OAuth2) and tooling for signing/verifying requests.

Top-level projects

  • flask-app/ — a Python Flask server demonstrating several auth approaches. See flask-app/EXAMPLES.md and flask-app/README.md for how to run the server and example curl commands. The flask-app/utilities/ package includes utilities for JWT handling and request signatures, and flask-app/certs/ contains example self-signed certs for local HTTPS testing.

  • nextjs-app/ — a Next.js (TypeScript) frontend that demonstrates client-side examples and a tiny API that exercises the same auth patterns. Check nextjs-app/README.md and the app/api/*/route.ts endpoints. Components under nextjs-app/components/ show how to build authenticated calls from the browser.

  • nodejs-express/ — a Node.js/Express server with equivalent examples to the Flask app. See nodejs-express/EXAMPLES.md and nodejs-express/README.md for usage. Helpers are in nodejs-express/utils.js and the scripts/ folder contains utility scripts (for example request signing).

Quick links (examples)

  • Flask app examples: flask-app/EXAMPLES.md (curl examples and how to run flask-app/app.py).
  • Next.js examples: nextjs-app/README.md and the API route handlers in nextjs-app/app/api/ (see jwt-auth, api-signature, api-key, basic-auth, token).
  • Node/Express examples: nodejs-express/EXAMPLES.md and nodejs-express/index.js / nodejs-express/app.js for server entry points.

Quickstart (local testing)

  1. Flask app (requires Python 3.11+ and the dependencies in flask-app/requirements.txt): install requirements and run the server (example):

    • Create a venv, install dependencies, then run flask-app/app.py. The flask-app/EXAMPLES.md file contains example curl commands, including HTTPS examples using the bundled flask-app/certs/ self-signed certs.
  2. Next.js app (requires Node.js & npm/yarn): from nextjs-app/ run npm install then npm run dev (see nextjs-app/README.md for details). The local API routes mirror the auth demos.

  3. Node/Express app (requires Node.js & npm): from nodejs-express/ run npm install then node index.js (or node app.js) — see nodejs-express/EXAMPLES.md for example requests.

Contributing

If you want to add more examples or improve explanations, please submit a PR. Small, focused examples with clear README updates are easiest to review.

License

MIT License

About

Companion repository for my SENG 401 - Practical Cryptography lecture.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors