Skip to main content
← All work

Making SproulTech's own crypto swappable

Finding every hash, signature and encryption call in this site's own code, and routing each through a named helper so the algorithm can change.

Status

Live on sproultech.com. The helpers are in use; the scanner, Cupel, is public at https://github.com/1Aa1k/cupel.

Hashing call sites inventoried
41, in 7 categories
Free purposes now minting SHA3-256
14 (SHA-256 still accepted)
Scanner count today
56 call sites: 34 hash, 12 public-key, 5 symmetric, 5 key-derivation
Elapsed
3 h 13 min wall-clock, first helper commit to last live commit
Done by
One person with AI coding agents

What was done

The site's code had 41 hashing call sites across seven categories. Each one was listed and sorted by what breaks if its output changes, then routed through one helper with a named rule: the algorithm it makes new values with and the list it accepts.

Fourteen free purposes now make new values with SHA3-256 and still accept SHA-256, so nothing signed before the switch stops verifying. The purposes whose output is stored or sent outside the repository stay pinned, unchanged.

The same treatment then went to the other two families. The Telnyx Ed25519 webhook check and the AES-256-GCM sealing of calendar tokens now sit behind named-purpose helpers in src/lib/crypto. Tokens sealed before the change still open, and a golden test checks that. ChaCha20-Poly1305 is ready in the helper but not active.

The scanner

scripts/hash-scan.mjs lists crypto call sites in a JavaScript or TypeScript tree (the public Cupel also scans Python, Go and Java): hashes, signatures, encryption and key derivation. It is line-based pattern matching, not a parser, so a clean run means no known pattern was found, not proof. Run on this site's src folder it reports 56 call sites in 860 files. It is called Cupel and is public at https://github.com/1Aa1k/cupel (MIT). Run it with `npx github:1Aa1k/cupel --check`, which fails a CI run on any crypto call outside the allowed folders.

How long it took

3 hours 13 minutes of wall-clock time, from the first helper commit (2026-11-30 14:14) to the last live commit (2026-11-30 17:27), read from git timestamps. It was done by one person working with AI coding agents. The clock starts at the first helper commit.

The method is written up as a service on sproultech.com/crypto-agility and sproultech.com/hash-algorithm-migration.