Codecademy Practice

Password encryption - Part 1

Challenge: Your product manager was very pleased with the login form you built some time ago, however some clients have concerns about security.

They are worried about us sending their passwords to our server in plain text as some “man-in-the-middle” could intercept them. Can you look into encrypting them?

You do your research and find out about bcript, which is a widely used encryption algorithm. But you don’t want to implement bcript all from scratch! Has someone done that already and released it as an open source library?

Surfing the web you find this weird Octopus user who shared a bcript library but didn’t put intructions in the README on how to use it. Developers these days! Can you figure out how it works just by studying how it’s used in the different examples provided?

99% of your time as a developer will be spent reading code that others (or even yourself) wrote. You decide to download the repository to play with it locally.

You will use the bcrypt library to hash (encrypt) the login’s password, and the password that the user enters. Then, instead of comparing the two passwords in plain text as before, compare their hashes.

To practice: using libraries, higher order functions

Example: Same as in the original password validation challenge.

Step by step instructions:

HTML

No changes.

CSS

No changes.

JS

GIT

Work in the same project you created for the login, in a separate branch. When the branch is ready create a pull request and ping me to review.

DEBUGGING

Use console.log() as usual.