Cybersecurity Tutorials and Notes
12 posts on cybersecurity, newest first.
This page collects GeekCoding101’s hands-on cybersecurity posts. They cover how authentication actually works (passwords, HTTP Basic Auth, JWT, OAuth 2.0, ID tokens vs access tokens), how to secure AI tooling such as MCP servers and Claude Code, threat modeling with STRIDE, certificates with OpenSSL, and reverse engineering with Ghidra MCP. Most posts include code or commands you can run on your own machine. Everything is free to read, with no sign-up.
Start here
| If you want to… | Read | What you’ll get |
|---|---|---|
| Understand the OAuth 2.0 grant types | OAuth 2.0 Grant Types Explained (Is PKCE One?) | Authorization code, implicit, password, client credentials and refresh tokens compared, plus where PKCE fits |
| Follow the authorization code flow request by request | OAuth 2.0 Authorization Code Flow, Step by Step | Each redirect and request, and why the server returns a code instead of an access token |
| Know which token goes where | ID Token vs Access Token: What Each One Is For (with a Demo) | Real decode and validation runs |
| Protect an MCP server | MCP Authorization: Protect an MCP Server with OAuth 2.1 | The 401, protected resource metadata, and a runnable Python SDK server |
| Stop Claude Code permission prompts safely | Claude —dangerously-skip-permissions: What It Does and When to Use It | The six permission modes and safer alternatives |
| Threat-model a system | STRIDE Threat Modeling Explained with an Example | All six STRIDE categories applied to a chat app |
| Reverse engineer a binary with AI help | Ghidra MCP: Let AI Help You Reverse Engineer Binaries | Install Ghidra 12.1.4 and GhidraMCP 2.0, then find Adler-32 in a stripped binary |
Authentication fundamentals (Auth101 series)
The Auth101 series builds up authentication in Node.js one method at a time. Reading the posts in order works best:
- Password Authentication in Node.js: A Step-by-Step Guide. The username-and-password baseline that most systems still start from.
- HTTP Basic Authentication Explained (RFC 7617). Covers the
Authorizationheader, Base64-encodedusername:password, why it must run over HTTPS, and a Node.js and TypeScript middleware example. - Unlocking Web Security: Master JWT Authentication. Explains JWT claims, token structure and signing algorithms, then builds JWT auth from scratch in Node.js with complete, runnable code.
OAuth 2.0 and tokens
OAuth is about delegated access: letting an app act for a user without handing it the user’s password. These three posts go from the overview down to the details:
- OAuth 2.0 Grant Types Explained (Is PKCE One?). Each grant type and when to use it. Short answer on PKCE: it is an extension that hardens the authorization code flow, not a separate grant type.
- OAuth 2.0 Authorization Code Flow, Step by Step. The most widely used flow, traced redirect by redirect.
- ID Token vs Access Token: What Each One Is For (with a Demo). The ID token tells your app who signed in. The access token tells your API what the caller may do.
Securing AI agents and MCP
AI coding agents and MCP servers bring new versions of old problems: who is calling, and what are they allowed to do?
- MCP Authorization: Protect an MCP Server with OAuth 2.1. How MCP authorization works end to end, with a Python SDK server that rejects requests that lack a valid token.
- Claude —dangerously-skip-permissions: What It Does and When to Use It. What the flag really does, why it refuses to run as root, and safer ways to cut down on prompts: allow rules, sandbox and auto mode.
Threat modeling
- STRIDE Threat Modeling Explained with an Example. Spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege, each applied to a chat app design.
Certificates and PKI
- Mastering OpenSSL Command and NSS Database Management. A practical OpenSSL and certutil guide. It covers inspecting certificates, managing PKCS#12 (PFX) files, and working with the NSS certificate database.
Reverse engineering
- Ghidra MCP: Let AI Help You Reverse Engineer Binaries. A hands-on GhidraMCP walkthrough on an Apple Silicon Mac. It installs Ghidra 12.1.4 and GhidraMCP 2.0, then uses MCP to locate zlib’s Adler-32 in a stripped binary.
- 9 min read
What Is Salting? Password Salting in Python
What is salting? A salt is a unique random value added to each password before hashing. See why plain SHA-256 leaks, then salt by hand and with Argon2id.
- 9 min read
ID Token vs Access Token: What Each One Is For (with a Demo)
ID token vs access token: the ID token tells your app who signed in, the access token tells your API what the caller may do. Real decode and validation runs.
- 9 min read
MCP Authorization: Protect an MCP Server with OAuth 2.1
How MCP authorization works: the 401, protected resource metadata and OAuth 2.1 flow, plus a runnable Python SDK server that rejects requests without a valid token.
- 11 min read
Claude --dangerously-skip-permissions: What It Does and When to Use It
What claude --dangerously-skip-permissions really does, why it refuses to run as root, the six Claude Code permission modes, and safer ways to stop the prompts: allow rules, sandbox, auto mode.
- 19 min read
Ghidra 12.1.4 Install (ghidra_12.1.4_PUBLIC) and GhidraMCP
ghidra_12.1.4_PUBLIC is the folder the Ghidra 12.1.4 zip unpacks to. Get it from NSA's GitHub, verify the SHA-256, run it, then add GhidraMCP for AI.
- 11 min read
STRIDE Threat Modeling Explained: A Chat App Example
What STRIDE threat modeling is, the six threat categories, and a full worked example on a chat app with detection and mitigation for each threat.
- 8 min read
OpenSSL & certutil Cheat Sheet: Certs, PFX, NSS DB
OpenSSL and certutil commands: inspect certificates, convert PFX to PEM, fetch a server cert, and import, trust or export certs in an NSS database.
- 11 min read
JWT Authentication in Node.js From Scratch
How a JWT works (header, claims, signature, HS256 vs RS256), then build JWT access and refresh tokens from scratch in Node.js and TypeScript.
- 7 min read
OAuth 2.0 Authorization Code Flow with PKCE, Step by Step
How the OAuth 2.0 authorization code flow works: every redirect and request with PKCE, why you get a code, not a token, and the checks that keep it safe.
- 8 min read
OAuth 2.0 Grant Types: Which to Use, and Is PKCE One?
OAuth 2.0 grant types compared: authorization code with PKCE, client credentials, device code, refresh token, and why implicit and password are retired.
- 7 min read
HTTP Basic Authentication Explained (RFC 7617)
How HTTP Basic Auth works: the Authorization header, Base64 username:password, why it needs HTTPS, plus a Node.js and TypeScript middleware example.
- 10 min read
Node.js Password Authentication with bcrypt and TypeScript
Build register and login routes in Express and TypeScript, hash passwords with bcryptjs, and see what each part of a bcrypt hash ($2a$10$…) means.
FAQ
Where should I start if I’m new to authentication? Start with the Auth101 series in order: password authentication, then HTTP Basic Auth, then JWT. After that, move on to OAuth 2.0 grant types.
What are the OAuth 2.0 grant types? The classic set is authorization code, implicit, resource owner password credentials and client credentials, plus refresh tokens for getting new access tokens. The grant types post compares them and explains where PKCE fits.
What’s the difference between an ID token and an access token? An ID token is for your app: it says who signed in. An access token is for your API: it says what the caller is allowed to do. The ID token vs access token post shows both being decoded and validated.
Is HTTP Basic Authentication secure? Only over HTTPS. The credentials are just Base64-encoded, not encrypted, so anyone who can read the traffic can read the password. The HTTP Basic Auth post covers this and shows a middleware example.
Is GeekCoding101 free? Yes. Every post is free to read, and there is no sign-up.