The Lab

Six instruments, running live.

Anyone can list “Python” and “incident response” on a resume. These are the algorithms themselves — backpropagation, Lloyd’s algorithm, the SHA-256 compression function, chi-squared cryptanalysis and Welford’s online variance — implemented from scratch and running in front of you.

Everything on this page executes locally in your browser. No network requests, no analytics, no third-party libraries. Anything you type — including into the password analyzer — never leaves this tab.
0 dependencies 0 network calls ~1,000 lines of vanilla JS

01

Machine Learning

Supervised and unsupervised learning, both implemented without a library.

Neural Network Playground

supervised backpropagation

A fully-connected network with two tanh hidden layers and a sigmoid output, trained on mini-batches with momentum against binary cross-entropy. The background is the model’s decision surface, re-evaluated on a 44×44 grid every frame — you are watching the weights actually move. Click anywhere on the plot to add your own training point and see the boundary bend to accommodate it.

mlp.js — 2 → h → h → 1
decision boundary click to add a point
Dataset
Click adds class
Network — edge width is |weight|
Training loss
0Epoch
0.0000BCE loss
0.0%Train accuracy
0Parameters

k-Means Clustering

unsupervised Lloyd’s algorithm

Centroids start on randomly chosen data points — deliberately naive, so you can watch real convergence rather than a lucky initialisation. Each iteration assigns every point to its nearest centroid, then moves each centroid to the mean of its members. The run stops when no point changes cluster. Inertia is the within-cluster sum of squares.

kmeans.js — assign → update → repeat
feature space

Rings pulse around a centroid while it is still moving. The faint spokes show current cluster membERHSip; watch them snap when a point changes hands.

0Iteration
0.000Inertia (WCSS)
iteratingState

02

Cryptography & Security

Hashing, entropy, and classical cryptanalysis — the real algorithms, not descriptions of them.

SHA-256 Avalanche

hashing from scratch

SHA-256 is implemented directly in this page — message padding, the 64-round compression function, all of it — rather than calling crypto.subtle, so you can verify it is genuinely doing the work. The grid is the 256 output bits of your input’s digest. Flip a single bit of the input and roughly half of those output bits change: that is the strict avalanche criterion, and it is what makes a hash usable for integrity.

sha256.js — 64 rounds, 8 working variables
digest bits — amber = flipped
sha256(input) sha256(input with one bit flipped)
0 / 256Output bits changed
0.0%Avalanche
50.0%Ideal

Password Entropy Analyzer

risk stays in your browser

Naive strength meters count character classes. This one starts from length × log₂(pool), then subtracts bits for the patterns an attacker would actually exploit — dictionary hits, character runs, repeats, keyboard walks and date-like digits — and converts the surviving guess count into wall-clock time under four attack models. Nothing you type is transmitted or stored.

entropy.js — charset + pattern penalties
Estimated time to crack

Times assume the attacker needs half the keyspace on average. Offline rates assume the hash has already been stolen — which is exactly why the algorithm a site chooses to store passwords with matters as much as the password itself.

0Length
0Charset pool
0.0Raw bits
0.0Effective bits

Classical Cipher Breaker

cryptanalysis χ² + index of coincidence

Encrypt something, then throw the key away and press Break it. For Caesar, all 26 shifts are scored with a chi-squared test against English letter frequencies. For Vigenère, the key length is first estimated from the index of coincidence — English text sits near 0.067, random text near 0.038 — and then every column is solved as an independent Caesar. The histogram shows observed frequencies against expected English. Frequency analysis needs volume — shorten the text much below a paragraph and watch the key-length estimate start guessing, which is exactly the real limitation of the technique.

cipher.js — frequency analysis
Letter frequency
Recovered key
Output
Cipher
Index of coincidence
1Key length
χ² vs English

03

Detection

Where the security work and the machine learning meet.

Live Threat Feed

anomaly detection Welford’s algorithm

The event stream below is simulated — but the detector scoring it is not. Each event is reduced to a feature combining how bursty its source currently is with how rare that (source, event-type) pair has been so far. A running mean and variance, maintained with Welford’s online algorithm, turn that feature into a z-score. Anything past the threshold is flagged. Press Inject attack to send a burst from a hostile host and watch the score break out of the baseline.

detector.js — z-score × rarity
TimeSourceEventScore
Anomaly score over time
0Events processed
0Flagged
0.00Running mean
0.00Running σ