Added authentication and hashing function to hash password