1 00:00:00,000 --> 00:00:09,283 [MUSIC] 2 00:00:09,283 --> 00:00:10,210 Hey everyone, Alena here. 3 00:00:11,780 --> 00:00:15,610 Practice is vital to becoming a proficient developer. 4 00:00:15,610 --> 00:00:19,480 It solidifies what you've learned causing it to stick in your memory. 5 00:00:19,480 --> 00:00:21,040 With deliberate practice, 6 00:00:21,040 --> 00:00:26,610 it becomes quicker and easier to solve the challenges that you'll face everyday. 7 00:00:26,610 --> 00:00:30,350 This session covers hashing passwords with bcrypt. 8 00:00:30,350 --> 00:00:33,704 This practice session is intended to follow the introduction to 9 00:00:33,704 --> 00:00:35,014 application security. 10 00:00:35,014 --> 00:00:39,634 If you haven't taken that course already, make sure you jump over and 11 00:00:39,634 --> 00:00:44,120 view all the important information that course covers. 12 00:00:44,120 --> 00:00:47,820 There are links to additional courses in the notes attached to this video. 13 00:00:48,940 --> 00:00:52,340 I've started you out with a couple of constants which you'll be using for 14 00:00:52,340 --> 00:00:53,035 this challenge. 15 00:00:53,035 --> 00:00:57,530 SaltRounds will be used for hashing the string, and 16 00:00:57,530 --> 00:01:01,520 original hash will be used to compare against a hashed value. 17 00:01:02,520 --> 00:01:09,101 Step 1, install and include the bscript npm package. 18 00:01:09,101 --> 00:01:13,670 Step 2, hash the string 'password' and display it to the screen. 19 00:01:14,720 --> 00:01:21,220 Step 3, hash the string 'bad_password' and display that to the screen as well. 20 00:01:21,220 --> 00:01:24,020 Step 4, use the bcrypt package 21 00:01:24,020 --> 00:01:29,340 to compare the string 'password' with the variable originalHash. 22 00:01:29,340 --> 00:01:32,320 Step 5, use the bcrypt package 23 00:01:32,320 --> 00:01:37,770 to compare the string 'bad_password' with the variable originalHash. 24 00:01:37,770 --> 00:01:42,240 It's okay to make multiple attempts before coming to a solution. 25 00:01:42,240 --> 00:01:44,640 That struggle to remember what you've learned and 26 00:01:44,640 --> 00:01:49,390 apply it to the situation is what causes the knowledge to take root. 27 00:01:49,390 --> 00:01:51,110 If you do get stuck, 28 00:01:51,110 --> 00:01:55,860 I've included additional resources in the notes associated with this video. 29 00:01:55,860 --> 00:01:59,900 Go ahead and give it a try, and I'll show you my solution in the next video.