This class can be used to perform CAPTCHA validation presenting simple mathematical expressions to the users to make it difficult for robots to pass a form being validated.
It displays a mathematical expression of a sum between two random numbers and asks the user to enter the result in a text form input.
The class generates an hash of the result using a secret prime number that is passed in an hidden form input.
When the user enters the result, the class validates it comparing the hash of the value entered by the user with the hash passed in the hidden input. |