1
00:00:00,360 --> 00:00:03,070
Not bad, not bad if we take a look at our database.

2
00:00:03,090 --> 00:00:07,280
We should see users collection and overall life is great.

3
00:00:08,220 --> 00:00:13,680
If only not for one big news, you noticed how we store password our strength.

4
00:00:14,460 --> 00:00:21,570
So now if someone breaks into my database, he or she can easily ruin the life for all my users, since

5
00:00:21,570 --> 00:00:25,660
in most cases people use the same password for everything.

6
00:00:26,160 --> 00:00:33,450
So if there's one thing I want you to take away from this course, please never, ever store user passwords

7
00:00:34,050 --> 00:00:34,440
strength.

8
00:00:34,980 --> 00:00:36,390
Trust me, they will.

9
00:00:36,390 --> 00:00:37,550
Thank you for that later.

10
00:00:37,920 --> 00:00:39,900
OK, but what's the solution?

11
00:00:40,290 --> 00:00:48,210
Well, we want to hash them instead, which in simple terms means generating random bytes and combining

12
00:00:48,210 --> 00:00:52,020
it with the password before we pipe it through the hash function.

13
00:00:52,350 --> 00:01:01,140
A mathematical algorithm that maps data of any size to a bit string of six times something to remember.

14
00:01:01,140 --> 00:01:05,349
Hashing is a one way street, meaning it cannot be reversed.

15
00:01:05,790 --> 00:01:12,930
Also, if the input changes even a tiny bit, the resulting hash will be completely different, which

16
00:01:12,930 --> 00:01:19,290
is really, really good for storing passwords since we can accomplish two things at once store passwords

17
00:01:19,290 --> 00:01:28,050
in a form that protects them, even if the password itself is compromised, at the same time being able

18
00:01:28,050 --> 00:01:36,390
to verify the correct user password, both of which will cover extensively in the upcoming lessons when

19
00:01:36,390 --> 00:01:43,710
it comes to password, hashing orders and following projects will use a library by the name of B Scripture's

20
00:01:44,040 --> 00:01:44,390
can.

21
00:01:44,400 --> 00:01:51,930
The library is called B Creped Jazz and if you're using a star I already installed for you so you can

22
00:01:51,930 --> 00:01:53,850
start using it right away.

