Your mission
Return the message length inside a padded block, or reject the block when the padding is not right.
today's brief
Crypto '98, Santa Barbara. Daniel Bleichenbacher shows that a server which answers bad padding differently from bad data will decrypt anything you like, one question at a time. About a million questions, hence the name. Nineteen years later ROBOT found the same hole still open in load balancers that were shipping at the time. Read the block before you trust what is inside it.
See it in action
message_length({2,9,9,9,9,9,9,9,9,0,65,66,67}, 13)3message_length({2,9,9,9,9,9,9,9,0,65}, 10)-1message_length({2,9,9,9,9,9,9,9,9,0}, 10)0
Your checklist
Constraints
- Expected file
pkcs.c- Allowed functions
- None. Write every helper yourself.
