$ cat writeup.md…
$ cat writeup.md…
Securinets CTF Quals 2026
Task: Given arrays x, y with y[i] = a * x[i]^2, recover the hidden coefficient a each round using only an integer-array calculator whose reads are capped to [0,255]. Solution: combine a float-ULP residue reduction (read any value mod 256) with x^62 * y_i = a mod 256 for odd x_i and a first-odd-index product selector.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Yet another Calculator,the interaction is the same as the old one but there's something more to it
The service (nc calculator-crypto.securinets.tn 4874) hands us two integer arrays x and y with the relation
y[i] = a * x[i]^2 (a random 8-bit coefficient)
and exposes a small arithmetic engine that operates on those arrays. We may read exactly one cell per round, but the read is capped to the range [0, 255]. After the read, the server asks for the coefficient a itself, and a wrong answer closes the socket. There are 16 rounds per connection, and both arrays plus a are regenerated every round, so all 16 rounds must be played on the same connection to get the flag.
This is the sequel to "Old Calculator", where the relation was affine (y = a*x + b) and the leak was a straightforward IEEE-754 pack/unpack. Here the map is quadratic and the hidden quantity is the coefficient, not a cell — which kills the direct float-leak approach used before.
One JSON object per line. Reverse engineering by fuzzing hundreds of operation names showed that only five operations exist:
| operation | meaning |
|---|---|
add | dst = src1[i1] + src2[i2] |
mult | dst = src1[i1] * src2[i2] |
add_const | dst = src[i] + C |
mult_const | dst = src[i] * C |
submit | read one cell, then ask for a |
...
$ grep --similar