2025
Posts from this year
Posts
-
Elliptic Curves from Scratch: Group Law, Double-and-Add and a Toy ECDH
Building elliptic-curve cryptography up from the chord-and-tangent rule to scalar multiplication and a working Diffie–Hellman exchange on a 103-point curve, then showing exactly why that curve is worthless.
-
King Halo: When a Zero-Knowledge Circuit Forgets to Constrain the Path Length
A write-up of the crypto challenge King Halo from WannaGame Championship 2025, where a Halo2 Merkle circuit verifies a path without constraining its length, so an empty path reduces the whole proof to leaf equals root and membership is never proved at all.
-
CO: A Cubic Surface, a Hyperplane Section, and a Flag Collected One Small Prime at a Time
A write-up of the crypto challenge CO from WannaGame Championship 2025, where the group lives on a cubic surface in projective 3-space, a hyperplane through the given points cuts it into an ordinary elliptic curve, and the same secret scalar reused across attacker-chosen primes falls to Pohlig-Hellman and the CRT.
-
Interesting Signing: One Byte Into the Modulus, Then an Orthogonal Lattice Factors It
A write-up of the crypto challenge Interesting Signing from WannaGame Championship 2025, where a one-byte overflow into the RSA modulus turns the CRT recombination into a linear equation over the integers, and ten of those equations let an orthogonal lattice recover the private CRT coefficients and factor a 3072-bit modulus.
-
Trust Across Virtual Hosts: Resuming a TLS 1.3 Session Past mTLS, Then a Signed Plugin to RCE
A write-up of the web challenge Trust from WannaGame Championship 2025, where a TLS session cache shared between two nginx virtual hosts lets a ticket from the public site skip client-certificate checks on the employee site, and a plugin upload that verifies a signature but extracts appended data and symlinks plants a JSP shell.
-
CI for a Static Site: What This Repository Actually Runs
The four GitHub Actions workflows behind this site and the six they replaced, read from the YAML, plus the concurrency, pinning and permission habits worth adding to any static-site pipeline.
-
just-exit: Getting a Shell by Asking for a Syscall That Is Forbidden
A write-up of the pwnable challenge just-exit from DreamHack CTF Season 7, where every modern mitigation is on and the exploit is a single byte, because the seccomp filter answers a denied syscall with SIGSYS and the program's SIGSYS handler calls system.
-
ABN Gallery: The Host a Checker Reads and the Host a Socket Dials
A write-up of the web challenge ABN Gallery from DreamHack CTF Season 7, where a hand-written host extractor and the runtime's own URL parser disagree about what "0" means, and that one character of disagreement turns an SSRF guard into a path traversal on the flag.
-
Attention in NumPy: Scaled Dot-Product, Masks and Multiple Heads
Implementing scaled dot-product and multi-head attention from scratch, explaining the square-root scaling with a measurement, and reading attention heatmaps on a toy sequence.
-
Amdahl, Gustafson and a Real Scaling Curve: Fitting the Serial Fraction of a Python Pool
Strong and weak scaling of a Python multiprocessing integration on an eight-core laptop, a fit of Amdahl's law, why a weak-scaling speed-up needs its baseline, and where the overhead comes from.
-
A Raspberry Pi Bench for UART, SPI and I²C
Turning a Raspberry Pi into a hardware lab, with wiring and logic levels, enabling the buses, reading a firmware console with pyserial, dumping an SPI flash with spidev, and the safety rules that keep both boards alive.
-
A Performance Budget for This Very Site
What it took to halve the same-origin CSS and JavaScript on every page of this Jekyll site, with the before-and-after bytes and the check that keeps it that way.
-
Convolutions, Receptive Fields, and Why Stacked 3×3 Kernels Work
A NumPy conv2d, the arithmetic of receptive-field growth, an edge-detection example on a synthetic image, and the parameter count that explains why modern CNNs use small kernels.
-
Threads, Reductions and False Sharing: Five Ways to Add Up Numbers in Parallel
A pthreads reduction measured five ways on an eight-core laptop: one shared atomic, packed per-thread counters, padded per-thread counters, register accumulators, and dynamic chunking, with a short primer on the C11 memory model that makes the fast version correct.
-
An Android App Security Assessment Checklist
A static-to-dynamic walkthrough for assessing an Android app you own, from APK structure and exported components to storage, network security config and certificate pinning, mapped to OWASP MASVS.
-
Reliable Background Jobs with Nothing but PostgreSQL
A job queue built on FOR UPDATE SKIP LOCKED, visibility timeouts, retries with jittered backoff and idempotent handlers, with the SQL and a Python worker.
-
Backpropagation by Hand: A Two-Layer MLP in NumPy with a Gradient Check
Deriving every gradient of a small multilayer perceptron, implementing it in NumPy, and proving the implementation right with a finite-difference check before training it.
-
SIMD on the Laptop: NEON Intrinsics, Auto-Vectorisation and the Loop That Would Not Vectorise
Dot product and saxpy in single precision, scalar vs auto-vectorised vs NEON intrinsics, measured from L1, L2 and DRAM on an Apple-silicon laptop, with the assembly and remarks that explain them.
-
KVM from the Ground Up: VMX, EPT and a Guest in a Hundred Lines of C
How hardware virtualization splits the CPU into root and non-root modes, how EPT translates guest memory, and what a minimal /dev/kvm program teaches about where the hypervisor attack surface really is.
-
A Pragmatic REST API, Decision by Decision
Resource naming, versioning, cursor pagination, idempotency keys, RFC 9457 errors and rate-limit headers, with the measurements and the OpenAPI to back them up.
-
Bias and Variance in Practice: Ridge Regression on Polynomial Features
The bias–variance decomposition measured instead of assumed, with ridge regression on a degree-12 polynomial, a regularization path and learning curves from a NumPy experiment.
-
Cache-Aware Matrix Multiplication: Loop Order, Tiles and the Register Block That Did the Work
Naive, interchanged, cache-tiled and register-tiled DGEMM in plain C, auto-vectorised by clang, measured for N = 256 to 1024 on an Apple-silicon core and placed on the roofline.
-
A Minimal Linux Kernel Module, and How to Read the Oops When It Breaks
Building and loading an out-of-tree module, crossing the user/kernel boundary safely with copy_from_user, and decoding the oops and stack trace that a kernel-mode mistake produces.
-
Ports and Adapters in a Go Service
A hexagonal layout for a small Go service, with interfaces at the boundary and a core you can test without a database.
-
Policy Gradients from First Principles: REINFORCE, Variance and Baselines
Deriving the REINFORCE estimator step by step, seeing where its variance comes from, and checking the baseline argument numerically on a tiny NumPy environment.
-
The Roofline Model on a Laptop: Measuring the Bandwidth Slope, the FMA Ceiling and the Ridge
Arithmetic intensity and the bound P = min(π, βI), with the bandwidth roof and FMA ceilings measured in C on one core of an Apple-silicon laptop, and a kernel walked across the ridge.
-
From Reflected XSS to a Real Content-Security-Policy
How script injection actually happens, why output encoding and CSP are different layers, and how to roll out a nonce-based policy without breaking production.
-
Designing a URL Shortener, Properly
Requirements, back-of-the-envelope capacity numbers, the data model, base62 versus hashing for IDs, and what to do when one link goes viral.