Home
Writeups Misc About
Vote for Pedro

Vote for Pedro

First, the modulus is big (2048 bits) and the public exponent e is small (3), hence we may use a small number and the arithmetic operation under the modulo N is the same as in Z

Pedro is not exactly careful with the padding, indeed:

Anything in the verified_vote variable before the null byte is discarded, hence a message of the form <SOME RANDOM STUFF>\x00VOTE FOR PEDRO is still valid. The form of such message will be x256l+1+m where x denotes the random text, l is the length of the message VOTE FOR PEDRO, and m is the previous message. The message must also be a perfect cube, so that we can obtain the message from verified_vote.

Sage Implementation: