made prototype function to validate passwords against hashes