(a) Ruhr strikes again.
(b) This is one of the all-time great cryptography footguns: not filling the ECDSA modulus.
Couldn't be any more thrilled.
(a) Ruhr strikes again.
(b) This is one of the all-time great cryptography footguns: not filling the ECDSA modulus.
Couldn't be any more thrilled.
Sean's writeup of the mechanics of this attack in his Cryptopals set 8 is *so good*.
The big thing here is is a programmer-brain impedance mismatch.
You need a cryptographically random 521 bit modulus, to work P-521. Your libraries easily generate 512-bit moduli. 512 bits seems essentially as cryptographically unguessable as 521 bits. If these were like, AES keys, the distinction would not matter.
But it matters a fuckload in asymmetric cryptography, because 521-512 leaves 9 bits biased to 0, which over a collection of signatures lets you set up a linear algebra problem to recover the secret key.