Bird
0
0

Which of the following is the correct way to hash a password using Werkzeug in Flask?

easy📝 Syntax Q12 of 15
Flask - Security Best Practices
Which of the following is the correct way to hash a password using Werkzeug in Flask?
Ahashed = make_password(password)
Bhashed = generate_password_hash(password)
Chashed = password_hash(password)
Dhashed = hash_password(password)
Step-by-Step Solution
Solution:
  1. Step 1: Recall Werkzeug's hashing function

    Werkzeug provides generate_password_hash to hash passwords securely.
  2. Step 2: Identify correct function usage

    The correct function call is generate_password_hash(password), other options are invalid or non-existent.
  3. Final Answer:

    hashed = generate_password_hash(password) -> Option B
  4. Quick Check:

    Use generate_password_hash() to hash passwords [OK]
Quick Trick: Use generate_password_hash() from Werkzeug to hash passwords [OK]
Common Mistakes:
MISTAKES
  • Using non-existent functions like hash_password
  • Confusing hashing with encryption functions
  • Trying to hash passwords manually

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes