Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! does anyone have the answer for Lab 2 exercise 6 of the MIT class called 6.858? specifically Spring 2022. Ill leave the instructions below

Hello! does anyone have the answer for Lab 2 exercise 6 of the MIT class called 6.858? specifically Spring 2022. Ill leave the instructions below :
Exercise 6. Implement password hashing and salting in your authentication service. In particular, you will need to extend your Cred table to include a salt column; modify the registration code to choose a random salt, and to store a hash of the password together with the salt, instead of the password itself; and modify the login code to hash the supplied password together with the stored salt, and compare it with the stored hash. Don't remove the password column from the Cred table (the check for exercise 5 requires that it be present); you can store the hashed password in the existing password column.
To implement PBKDF2 hashing, you can use the Python PBKDF2 module. Roughly, you should import pbkdf2, and then hash a password using pbkdf2.PBKDF2(password, salt).hexread(32). We have provided a copy of pbkdf2.py in the zoobar directory. Do not use the random.random function to generate a salt as the documentation of the random module states that it is not cryptographically secure. A secure alternative is the function os.urandom.
Run make check to verify that your hashing and salting code passes our tests. Keep in mind that our tests are not exhaustive.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Explain why talent management is important.

Answered: 1 week ago