Password recovery function

The solution is ready for tests