The values stored in the password file are being created by a mathematical 'one-way' function from the password you give.
Later on, the password the user enters is put through the same one-way function, and then it is seen wether the two results match.
There's no way to efficently find a valid password given the result of the one way function.