How should passwords be hashed and verified?
Answer
Clear, interview-ready explanation
Passwords must be stored as one-way hashes, never as plaintext or reversibly encrypted values. Laravel’s Hash facade provides secure Bcrypt and Argon2 hashing, and Hash::make should be used when storing a new or changed password.
Use Hash::check to verify a supplied password against its stored hash, or use Laravel’s standard authentication services. Do not compare hashes manually or invent a custom hashing scheme. Keep the configured work factor appropriate for the environment, allow Laravel’s rehashing support to upgrade hashes when needed, and protect password-reset and login flows with throttling and secure transport.