CAPTCHA validation is being used everywhere on the Internet to make it difficult for robots to access sites that should be accessed only by real human user beings.
One of the problems is that most solutions are based on images. Obviously, such images cannot be read by blind users using regular text to speech conversion programs.
This class provides a CAPTCHA alternative that is not based on images, but rather on simple math operations.
This way, blind users can read what is written in the pages and pass the CAPTCHA validation tests giving the correct results to requested operations.
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.