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.

    10 min read 1,848 words Category: Security Tags: cryptography, elliptic curves, python

  • 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.

    6 min read 1,062 words Category: Security Tags: ctf, cryptography, zero knowledge

  • 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.

    8 min read 1,528 words Category: Security Tags: ctf, cryptography, elliptic curves

  • 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.

    9 min read 1,704 words Category: Security Tags: ctf, cryptography, rsa

  • 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.

    6 min read 1,120 words Category: Security Tags: ctf, web security, tls

  • 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.

    10 min read 1,989 words Category: Software Tags: github actions, ci, jekyll

  • 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.

    6 min read 1,010 words Category: Security Tags: ctf, pwn, linux

  • 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.

    7 min read 1,396 words Category: Security Tags: ctf, web, ssrf

  • 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.

    8 min read 1,556 words Category: AI Research Tags: nlp, transformers, attention

  • 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.

    10 min read 1,965 words Category: HPC Tags: scaling, amdahls law, multiprocessing

  • 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.

    11 min read 2,143 words Category: Security Tags: hardware, raspberry pi, embedded

  • 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.

    11 min read 2,041 words Category: Software Tags: web performance, jekyll, frontend

  • 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.

    8 min read 1,535 words Category: AI Research Tags: computer vision, convolution, deep learning

  • 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.

    11 min read 2,004 words Category: HPC Tags: pthreads, false sharing, atomics

  • 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.

    11 min read 2,081 words Category: Security Tags: mobile security, android, owasp

  • 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.

    12 min read 2,295 words Category: Software Tags: postgresql, backend, python

  • 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.

    8 min read 1,437 words Category: AI Research Tags: deep learning, backpropagation, numpy

  • 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.

    15 min read 2,913 words Category: HPC Tags: simd, neon, clang

  • 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.

    12 min read 2,299 words Category: Security Tags: virtualization, kvm, systems security

  • 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.

    9 min read 1,769 words Category: Software Tags: api design, http, openapi

  • 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.

    7 min read 1,386 words Category: AI Research Tags: machine learning, regularization, statistics

  • 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.

    15 min read 2,951 words Category: HPC Tags: matrix multiplication, cache blocking, vectorization

  • 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.

    11 min read 2,007 words Category: Security Tags: linux kernel, systems, c

  • 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.

    11 min read 2,027 words Category: Software Tags: go, architecture, testing

  • 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.

    8 min read 1,570 words Category: AI Research Tags: reinforcement learning, policy gradient, numpy

  • 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.

    13 min read 2,531 words Category: HPC Tags: roofline, memory bandwidth, performance modeling

  • 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.

    9 min read 1,797 words Category: Security Tags: web security, xss, csp

  • 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.

    11 min read 2,102 words Category: Software Tags: system design, databases, caching