Password recovery

Implements the password recovery procedure.