I need to know if there is some kind of known algorithm to generate security codes. This is the scenario:
I have a web application, where the users has a password and an email to be identified and authenticated into the application. In case the user forgots his password, I was required to enable the funcionality of recovering it in the following way:
This should wor
- k with a window, where the user enter his email, and click on a button called "forgot password" (or something similar)
- This button should send a security code to the users email
- Then the application redirects the user to a new page, where the user must enter the security code received in his inbox
- If the security code entered by the user is valid, then he is redirected to a page where he can introduce a new password.
What I'm looking for, is for some kind of known ways to generate the security code (step 2) and to validate this security code (step 4)
Thanks in advance