Hashing Algorithms
Which of the following hashing algorithms is generally considered the most secure option for storing passwords?
- MD5
- SHA-1
- bcrypt
- SHA-256
- Salted SHA-1
Salting Passwords
What is the primary purpose of salting passwords before hashing them?
- To make the hashing process faster
- To reduce the storage space required for passwords
- To prevent rainbow table attacks
- To encrypt the password before hashing
- To simplify password recovery
Password Complexity
Why is enforcing password complexity policies, such as requiring special characters, not always effective?
- Complex passwords are easy to remember
- Complex passwords are harder to crack with modern techniques
- Users often choose predictable patterns or slight variations, reducing their effectiveness.
- Complexity policies increase user satisfaction
- It prevents phishing attacks
Password Storage Best Practice
Which of these is the best practice for storing passwords?
- Storing passwords in plain text
- Hashing passwords with MD5 without a salt
- Storing passwords using reversible encryption
- Hashing passwords using bcrypt with a unique salt for each user
- Storing passwords in a configuration file
Two-Factor Authentication
What is the main advantage of using two-factor authentication (2FA)?
- It makes password reset easier
- It eliminates the need for passwords
- It adds an extra layer of security, even if the password is compromised
- It speeds up the login process
- It protects against brute-force attacks
Authentication Tokens
What is the purpose of a JSON Web Token or JWT in authentication?
- To store passwords securely on the client-side
- To allow access to resources without re-authenticating for each request
- To encrypt sensitive data transmitted over the network
- To validate user input and prevent SQL injection attacks
- To manage user sessions using cookies
Rate Limiting
Why is it important to implement rate limiting on authentication endpoints?
- To improve user experience by reducing login time
- To prevent denial-of-service (DoS) and brute-force attacks
- To reduce server load during peak traffic
- To comply with privacy regulations
- To improve search engine optimization (SEO)
Password Reset Flows
In a secure password reset flow, what is crucial to prevent account takeover?
- Using a simple, predictable password reset token
- Sending the new password directly in the email
- Validating the user's email address and using a securely generated, time-limited token
- Not requiring email validation for password resets
- Making the password reset token valid indefinitely
Local Storage Security
Which of the following statements is most accurate regarding storing authentication tokens in browser's local storage?
- Local storage is inherently secure and resistant to XSS attacks
- It's best for highly sensitive tokens as it is encrypted by default.
- Local storage is vulnerable to Cross-Site Scripting or XSS attacks, so tokens should be carefully managed and protected.
- Local storage is less vulnerable than cookies.
- Local storage automatically expires tokens.
Multi-Factor Authentication Methods
Which of the following is a common method used for Multi-Factor Authentication?
- Using the same password across multiple sites
- Security questions with easily guessable answers
- Sending a one-time password via SMS or email
- Disabling browser security warnings
- Forwarding all your emails to a public address