A3 · The graveyardNo leak
Machine learning predicts p mod k
Train a model to guess p mod 3, 5 and 7 from N. It sits at chance for all three, while a planted leak is caught every time.
The idea
We give a model everything easy about N: its remainders mod 3, 4, 5, 7, 8, 9, 11 and 13 (60 yes/no features) and its last 16 binary digits, plus a constant: 77 numbers in all. It must predict p mod 3, p mod 5 or p mod 7 for the smaller prime p of each . On proper keys it lands at chance: 50%, 25% and about 17% (1 in 2, 4 and 6 equally likely remainders). To be sure the model could learn a real signal, we also train it on keys from a broken generator, and there it scores nearly 100% for every .
Watch it
The test
Ten seeded runs for each of p mod 3, 5 and 7. For each: train on fresh keys, test on 1,000 keys the model never saw. The shaded zone is where pure chance (1 in 2, 4 or 6) lands 95% of the time. The chart shows the picked above.
Fig. A3.2Held-out accuracy of the same model on proper keys and on keys from a leaky generator, ten seeds, for the picked modulus
Measuring…