A hash-based password generation algorithm