Password Hashing, Salts, Peppers | Explained!

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 250

  • @barborabrchelova7015
    @barborabrchelova7015 4 роки тому +379

    not all heroes wear capes, some of them make good tutorials

    • @subzerokar
      @subzerokar 2 роки тому +9

      how do you know if he is wearing a cape or not

    • @SV42165
      @SV42165 2 роки тому +1

      @@subzerokar jeez you been going to finishing school

    • @azoz1433alamodi
      @azoz1433alamodi Рік тому

      amen

  • @ayodejiakinborewa282
    @ayodejiakinborewa282 Рік тому +29

    I like when people can explain such complex things easily

  • @amandacapsicum686
    @amandacapsicum686 4 роки тому +55

    Thanks for the explanation of peppers! I didn't know that existed.
    However... Every time you teach people about MD5 without explicitly warning them it's been cracked, a cryptography fairy dies.

  • @brianhackit7900
    @brianhackit7900 7 років тому +148

    Jeez.
    I wish you taught my Comp-Sci class...
    Now I get it.
    Tx

    • @brianhackit7900
      @brianhackit7900 7 років тому +1

      && this educational stryle vid is a nice change too.

  • @hektikethnik
    @hektikethnik 6 років тому +14

    There are 2 concepts of a pepper
    1. What was explained here, a small random input that is iterated through when authenticating the user
    2. An input like the salt but the same for every password that is stored separately to the password (sometimes, but not wisely in the code itself)

    • @digitalalpha2
      @digitalalpha2 3 роки тому

      Hi, can you provide a reference to this! according to wikipedia only the 2nd one is mentioned there
      en.wikipedia.org/wiki/Pepper_(cryptography)

    • @Tiddle_s
      @Tiddle_s 3 роки тому

      @@digitalalpha2 If you asked me this 2 years ago I might have had an answer (or tripped over myself) but I honestly don't know what I meant with point 1 anymore.
      A pepper as I know it is point 2. The key points are that it is the same for all passwords, and not stored in the database (so a breach/dump doesn't expose it)
      If you're learning about password hashing I would dive into the PBKDF2 and bcrypt password hashing functions and what they do.

  • @PulseZ4
    @PulseZ4 3 роки тому +4

    Fantastic tutorial, thank you. I am studying for my CISSP exam and this made a lot of sense to me.

  • @juliavanderkris5156
    @juliavanderkris5156 7 років тому +85

    Great video. I knew about hashing and salting, but not about peppers. What do you think is better/safer? Or isn't there a "best way"?

    • @LiveOverflow
      @LiveOverflow 7 років тому +34

      the answer is, don't use hashes like sha1 for passwords. These hashes were not designed for passwords (read as: not designed to be inefficient and expensive to calculate). They were designed to be super fast to calculate - thus easy to bruteforce.
      So it's better to use something like BCrypt, PBKDF2, etc...

    • @juliavanderkris5156
      @juliavanderkris5156 7 років тому +1

      Randorn Canis Thanks. I didn't even think about using both, but I think I'll take a look at bcrypt. I've heard that a lot of people use it, but I've never really tried it.

    • @juliavanderkris5156
      @juliavanderkris5156 7 років тому +1

      LiveOverflow Thanks. But isn't this good news? On the server side, it doesn't matter if if takes a bit longer, but if someone uses a dictionary/brute force attack, it would? Anyways, I'll try out bcrypt.

    • @lucav4045
      @lucav4045 6 років тому +6

      LiveOverflow You here? Cool!

    • @leongladkowski3078
      @leongladkowski3078 6 років тому

      Same

  • @antonlinden5216
    @antonlinden5216 2 роки тому +1

    Nice video! Great concept!
    If anyone is thinking of implementing this into PHP as I first did, don't. It's already implemented in PHP with the function of password_hash & password_verify. Wish I knew that before I implemented it! haha

  • @yyyooohhhooo
    @yyyooohhhooo 3 роки тому

    Dude are you f**king crazy?!?!?
    You just spent 4 mins clearly explaining what I have been confused about for 4 days!!!
    Thank you!

  • @Liebe-Futurel
    @Liebe-Futurel Рік тому

    Thanks for the video! I was trying to figure out how salts were stored and you explained it perfectly

  • @yazidyusof3599
    @yazidyusof3599 7 років тому +1

    Doot doot. Did I get healthy bones? Great use of memes man, very dank

  • @EyalDelarea
    @EyalDelarea 3 роки тому +1

    Took you less than5 minutes to explain this topic.
    My teacher had an hour and a half and I still didn't get it.
    Thank you

  • @1marcelfilms
    @1marcelfilms 2 роки тому

    Hmm very interesting. I'll absolutely never need to know this so i will never forget

  • @dumeinstichbineinniemandni9390
    @dumeinstichbineinniemandni9390 7 років тому +34

    Awesome, clicked away, forgot to like so I went back and left a like :)

  • @natasharudenko9831
    @natasharudenko9831 6 років тому +3

    Thanks so much for this, doing a course with open uni, and this gave a bit more information and understanding than they provided. thanks!
    And it's good you have a nice clear and understand voice. Keep up the good work,

  • @dxdiagg
    @dxdiagg Рік тому +1

    Bruteforce using quantum computer would crack this for 10s

  • @BagOSalad
    @BagOSalad 7 років тому +4

    Thanks so much for these videos! it makes learning so much easier!

  • @examswillkillmeoneday1265
    @examswillkillmeoneday1265 6 років тому +3

    Thank you! This was explained really well, I understand it now.

  • @6lindfish
    @6lindfish 6 років тому +1

    Great video. 1 comment though: 3m47s "52 times longer" is only true if the attacker always guesses wrong until the last try. ;)

  • @-_lIl_-
    @-_lIl_- Рік тому

    remember:
    the most secure hashing algorithm is one that is not publicly known.

  • @xCwieCHRISx
    @xCwieCHRISx 2 роки тому

    Finally I understand what peppers are. I was always confused and thought pepper and salt are the same

  • @chujingxl
    @chujingxl 3 роки тому +1

    Thank you for this video! Very clear explanation. You are a good teacher.

    • @-_lIl_-
      @-_lIl_- Рік тому

      yeah, this video was really easy to understand

    • @-_lIl_-
      @-_lIl_- Рік тому

      yeah, this video was really easy to understand

  • @kevinjones5296
    @kevinjones5296 6 років тому +2

    Very well done ty I was confused till this point!!!

  • @alexandrosspyropoulos6235
    @alexandrosspyropoulos6235 5 років тому +1

    Quick and simple explained. Nice video!

  • @mrlildylchillin
    @mrlildylchillin 5 років тому +2

    snoop dogg and ali g as your example passwords - we are brothers from separate mothers

  • @rotareneGtxeN
    @rotareneGtxeN 7 років тому +7

    Genius without education is like silver in the mine.

    • @sam-yx8fr
      @sam-yx8fr 4 роки тому

      Baran Barış Yıldızlı what?

  • @leafofyume7838
    @leafofyume7838 10 місяців тому +1

    why only 1 pepper letter? deos using like 4 letters not produce a ton more possible hashes?

    • @caldeira_a
      @caldeira_a 6 місяців тому

      but the more digits you add the average time to match the password will increase exponentially, in the example, the time it takes for a user to login would ramp up extremely fast and become impractical

  • @nik6920
    @nik6920 3 роки тому

    I propose to use a dynamic salt and NOT TO STORE it anywhere, it will be re-evaluated every time login details change. Plus, a 100 pepper keys from which only a single passes

  • @eldrago19
    @eldrago19 4 місяці тому

    The description of a pepper here is interesting, but probably not a good idea. It is better to slow down authentication using a specifically designed system like bcrypt or scrypt.

  • @SuperElephant
    @SuperElephant 7 років тому

    Havent heard of peppers, but it was a great information learnt!
    Didn't even think of hackers might get the salts by dumping dbs
    They could still brute force it much easier like there's no salt added
    Just cant use rainbow tables.

    • @-_lIl_-
      @-_lIl_- Рік тому

      yeah but with rainbow tables all you have to do is simply check if hashes match, but without rainbow tables, you have to manually re-hash all of the passwords that you want to guess, making it a lot more hard to crack.

  • @RIP123
    @RIP123 8 місяців тому

    Thank you so much, this was so easy to understand!

  • @BoyFromMa
    @BoyFromMa 7 місяців тому

    I just finished typing a long comment exposing a lot of knowledge that has no business being exposed, but then I remembered the saying "do your filth and keep your mouth shut", so I deleted it. Still, I'm itching to say, this video made me realize how narrow minded most programmers are. Which is great news for me.

  • @vladislavkaras491
    @vladislavkaras491 Місяць тому

    Thanks for the video!
    It was greatly explained!

  • @pushpitsharma7546
    @pushpitsharma7546 7 місяців тому

    Very well explained 👏
    Thank you very much 😊

  • @herrmagicnils3716
    @herrmagicnils3716 2 роки тому

    So, for my understanding.
    If you own a rainbowtable, and you know the salt you can just add the salt to every unhashed password in the rainbowtable and hash them again, then you can throw the hash password with the salt into the rainbowtable again, and you will get the password right?
    So the Salt way is just to make it a bit harder/more annoying to get the password, like with the Papper way.

  • @Pipelanche
    @Pipelanche 4 місяці тому

    The Snoop Dog thing was so random

  • @se7en845
    @se7en845 6 років тому

    U make a simple topic so complex.

  • @AvgDan
    @AvgDan 2 роки тому

    I always thought pepper was a static string stored in the application added to the salt/pass. This random list of strings in your example is new to me. I don't think I'd use A-z but an array of strong strings instead. Honestly I think it should have been called something else, like hot-sauce, as I truly believe pepper started out as a static string (though I could be wrong).

    • @FastKnight401
      @FastKnight401 2 роки тому

      Technically, they're both peppers since they're both randomness not stored in the database, though storing 1 long string somewhere that's not the database it more useful than rediscovering the pepper every time, since the latter is just used to increase the time it takes to crack passwords, and you should really be increasing the iteration count if that's your goal. Storing a long string somewhere other than the application however, has the added benefit that a database breach still doesn't give enough information, and your application code, or wherever you're storing the pepper also has to be leaked, in which that case, it's basically the same as a salted password.

    • @flymoracer
      @flymoracer Рік тому

      @@FastKnight401 Yeah, my understanding is slightly different. There are more than one peppering strategies but the fundemental difference I understood was that the pepper is a secret peice of information, typically an HMAC key or similar, that is added to the password before hashing. The peppering described in the video is more like a calculated salt. A pepper should be protected and stored elsewhere, such as an HSM.

    • @Outwardpd
      @Outwardpd Рік тому

      @@flymoracer I was under the assumption that in the video they were describing that you store an array of peppers separately from the passwords for iteration, if that is the case would that not fit the definition of a pepper? Storing passwords with their peppers at all seems counterintuitive and would just mean there are now 2 databases that could be breached and individually cause problems increasing security risk via unnecessary broadening.

    • @flymoracer
      @flymoracer Рік тому

      @@Outwardpd Yeah, exactly. The case in the video seems to use a known array of pepper values, presumably stored in the application code, where each one gets appended to the supplied password in turn until a matched hash is found (or not if the password is incorrect). So the pepper value typically would not get stored along with the password. If it was I guess it would be a salt.

  • @balvantmistry8997
    @balvantmistry8997 6 років тому

    Great down to the point explanation.

  • @gorilillakk
    @gorilillakk 3 роки тому

    Very very well explained. Thx so much.

  • @thanh-tinhvu8769
    @thanh-tinhvu8769 Рік тому

    omg what is 1.56 timestamp??? I friggin LOVE IT!

  • @JarppaGuru
    @JarppaGuru 2 роки тому

    3:53 it takes many years longer when use multiple alcorith together and even reverse hash order between. hacker have know clue

  • @letsgetto1millwithoutvids
    @letsgetto1millwithoutvids 2 роки тому

    Or just change a few values of the sha256 code which is what I did and so it produces a completely different hash to what would be the sha256 hash then make it hash server side making it impossible as your code is private

  • @punditgi
    @punditgi 3 роки тому +1

    Excellent tutorial. More, please! 😃

  • @videos4mydad
    @videos4mydad 2 роки тому

    What about storing the hash of the hash of the hash....say 100 levels deep..... this also makes it computationally expensive

  • @raalgames
    @raalgames 2 роки тому

    EXCELLENT VIDEO! Thank you!

  • @rk.x01
    @rk.x01 5 років тому

    Nice explanation dear.
    I have query, that is
    1.pasdword+salt+pepper=hash value ?
    2.pasdword+pepper=hash value ?
    3. Pepper hash value not stored in database so than where it is stored ?
    Please reply me.

    • @LiEnby
      @LiEnby 5 років тому

      its not stored, you bruteforce the pepper on server side.

  • @HarshSingh-hk8fe
    @HarshSingh-hk8fe 3 роки тому

    that's reallt a gold content the way you explained is outstanding thanks alot bro :
    )

  • @BastianHodapp
    @BastianHodapp 2 роки тому

    Great, concise explanation, thanks :)

  • @fastrobreetus
    @fastrobreetus 2 місяці тому

    Great explanation

  • @liquidred257
    @liquidred257 3 роки тому +1

    if hashing is always 1 to 1(a given password will always result in a given hash), why cant hackers mess around with the hashing algorithm to discover a way to un-hash strings?
    also are all salts appended or can the be prepended or even put in the middle?

    • @liquidred257
      @liquidred257 3 роки тому

      also also, won't rainbow tables still be of use if the hacker knows where the "junk" characters are and simply removes them from the hash + salt, as hash +salt -salt = hash?

  • @aniket.kumarr
    @aniket.kumarr Рік тому

    thanks for the excellent resource.

  • @karimkohel3240
    @karimkohel3240 5 років тому

    liked it so much, would love to see more. not even breaking any stupid UA-cam laws

  • @sanjitselvan5348
    @sanjitselvan5348 2 роки тому

    Thanks for the explanation

  • @amarnath1365
    @amarnath1365 4 роки тому

    you cleared my doubt, it's very informative. thanks

  • @SurroundedByNonsense
    @SurroundedByNonsense 8 місяців тому

    I only have one question unto those who have a high level of expertise within this field can paswords be encrypted, hashed, salted, and peppered all at the same time thus virtually making it high level to crack by third parties and online viruses etc?

  • @swordofkings128
    @swordofkings128 3 роки тому

    Very well explained

  • @abdullahseba4375
    @abdullahseba4375 7 років тому +1

    A really good video, thanks man.

  • @suri5023
    @suri5023 Рік тому

    great explanation and easy to understand
    thank you for this tutorial.

  • @rodrigoruiz976
    @rodrigoruiz976 4 місяці тому

    I don't get how rainbow tables would not work assuming a hacker has access to the hashed password and the salt

  • @909sickle
    @909sickle 6 років тому

    If you have to store the salt in the database, then it would only prevent rainbow table attacks. If the attacker gets in the database, he can just add the salt to each attempt in his dictionary attack without slowing him down. So, salt only helps people with really bad passwords that exist in rainbow tables?

    • @-_lIl_-
      @-_lIl_- Рік тому

      while common passwords will always be found first, if the hashes are salted, then all the hashes in the rainbow table and dictionary attack would have to be recalculated, which ruins the whole purpose of dictionary attacks and rainbow tables. But the most common passwords will still be attempted to be hashed first nevertheless

  • @MVDW_Dev
    @MVDW_Dev 4 роки тому +2

    Is it more safe to hash the password 2 times? so like one to be used as salt and one to store in the database.

    • @ryannorooz
      @ryannorooz 4 роки тому

      then if two or more users have the same password, their salts would be the same too; resulting to identical password hashes in your database.
      that's one of the main things we are trying to prevent here!
      and it's also a best practice to make sure the salt isn't based on the password itself in any way .

  • @tiernanmorgan1753
    @tiernanmorgan1753 4 роки тому

    can you use both salt and pepper on top of a hash

  • @MuhammadIlham-vn5nq
    @MuhammadIlham-vn5nq 2 роки тому

    ohh thanks I didn't know that online website implemented rainbow table

  • @ChaceBonanno
    @ChaceBonanno 3 роки тому

    Are peppers used for scrypt? Whereas SHA256 lacks the pappers.

  • @florin-alexandrustanciu5643
    @florin-alexandrustanciu5643 3 роки тому

    3:51 why would it take 52 times longer to log in ?

  • @neurooted
    @neurooted 2 роки тому

    how the users application know if it should check peppers combinations?? has it to be implemented on the front end side?

  • @franciscovilches6839
    @franciscovilches6839 4 роки тому

    great explanation!

    • @abelgod6687
      @abelgod6687 4 роки тому

      Hey got everything done by *Realhacker001* on iG it’s legit worldwide hackers 💯💯💯💯💯😮😮😮👂👂👂❤️❤️❤️

  • @blanksec8772
    @blanksec8772 5 років тому

    can you please make a video on everything we need to know about cryptography in order to start cracking?

  • @OliverBevan23
    @OliverBevan23 4 роки тому

    Great explanation 👍

  • @faizanriaz5663
    @faizanriaz5663 6 років тому

    I have a question regarding pepper, you said that it’s not. Where it is not stored in dB or in rainbow table ? Bcz i have read a lot of articles on google and they all said that it’s stored with password(salt+password +pepper)... can you please explain little bit more so I can clear my confusion.

    • @philtrem
      @philtrem 6 років тому

      Let's say your pepper consists of a random letter of the alphabet, that gives you 26 possibilities for your pepper. So your authentication program will have to try all 26 possibilities for "password + salt + pepper" at login, which is negligeable. Whereas the attacker needs to compute a table that is effectively 26 times bigger. Now, the size of your pepper can be significantly more than that, with a negligeable cost to you, while the cost to the attacker is tremendous.

  • @CommanderCody4444
    @CommanderCody4444 5 років тому

    A salt is unique for every password, and it is added in anyway to the password, it does not have to be appended to the password.
    In the video you said a pepper is unique for every password, but they aren't. Salts are stored, so are unique, but a pepper is a secret, so the same pepper is used for every password.
    Also, salts and peppers do not have any length associated with them, and usually the longer they are, the better.

    • @Last_Resort991
      @Last_Resort991 2 роки тому

      Pepper can be implemented both ways. The way described in the video would also work and would be safer.

  • @benedictnino4672
    @benedictnino4672 Рік тому

    does pepper character is limited from a..Z and 0..1 or all character in ASCII unicode?
    *sorry if my question made you confuse

  • @minege02
    @minege02 7 років тому +5

    Hi, really good video, thanks :) !
    Maybe you should go a bit slower, sometime we need to pause the video to read the screen content.
    Thanks.

    • @18ps3anos
      @18ps3anos 4 роки тому

      That's what pauses are for..

  • @Ramon314
    @Ramon314 Рік тому

    (worst case is 52 times the time it takes without a pepper)*

  • @VictorGarcia-si8wy
    @VictorGarcia-si8wy 6 років тому

    Great video. Thanks man!!

  • @Lilo-A
    @Lilo-A 3 роки тому

    I actually got this. Thank you!

  • @laetitiamilet382
    @laetitiamilet382 7 років тому

    Great Video! Srry for bad English, I have a question, ho do you get into the deta base to get the hash?

  • @antwon5933
    @antwon5933 7 років тому

    Waiting for your Hak5 field kit use of each tool.

  • @abloogywoogywoo
    @abloogywoogywoo 4 роки тому

    Honestly, we're in 2020, all reputable websites should be using brute force attack detection software.

  • @Mangahome
    @Mangahome 7 років тому

    wow this was really simple to understand

  • @kuhak4780
    @kuhak4780 2 роки тому

    Never use standard MD5.

  • @LyicsChannel
    @LyicsChannel 5 років тому

    Thank you for this video!!

  • @sheepay99
    @sheepay99 Рік тому

    Nice, concise video.
    I encountered an issue recently when copying a test environment to a dev environment and was unable to login on the dev environment using the credentials copied over from test.
    For reference, I was using bcrypt in NodeJS.
    If the salt is stored in the database as a prefix to the hashed password, why is it that I couldn't login on the dev environment?

  • @sumeetagarwal6561
    @sumeetagarwal6561 6 років тому

    just to confirm, over http the password and the user name would be sent from the client to the server in plain text and in https (ssl) it would be encrypted? The methods detailed only help the server and database security, but the client is still very vulnerable?

  • @AstraGamesStudios
    @AstraGamesStudios 6 місяців тому

    Thank you!

  • @MegaGliders
    @MegaGliders 2 роки тому

    video was great thanks bro

  • @zanidd
    @zanidd 6 років тому

    that's a lot of hash at the beginning of the video

  • @CraftyZA
    @CraftyZA 2 роки тому

    Very old video but you did get a couple of things wrong, or at least not cover the entire story.
    for instance, a Rainbow table is not just a straight lookup table. You need to cover chains, and reduction as well to get a clearer picture.
    But Kudos on the salt and pepper. Companies like joomla even got it wrong at some point using a static salt for all users. Now if your hashes are compromised, it means your db was compromised, thus said actor has the content of the configuration as well, which means they know your salt, and can use any of the existing tables and leak those users.

  • @Gromst3rr
    @Gromst3rr 7 років тому

    Great video! Thank you!

  • @NORAAlmes
    @NORAAlmes 3 місяці тому

    I know it's weird question but does anyone know what accent is he speaking?

  • @Ahmad-hq7oz
    @Ahmad-hq7oz 6 років тому +4

    Great and funny video, pass: smoke weed everyday ;)

  • @musikdoktor
    @musikdoktor 5 років тому

    q: what do you think about hash a password with the same password as a salt.. only the user will "know" the salt and you don't need to store the salt..

    • @amandacapsicum686
      @amandacapsicum686 4 роки тому

      That is what's called security through obscurity. It will seem very secure until one hacker anywhere in the world figures it out! If that hacker tells the world, every hacker can try cracking the passwords assuming that you used that method. Suddenly, all the people in the world who used that method have to scramble to update their system!
      The best security is open source. This might seem counter intuitive but it's true. If your system is hard to crack even with the source code known, you have avoided the security through obscurity issue.

  • @MuckingFedic
    @MuckingFedic 7 років тому

    Really educational thank you

  • @Dan-tg3gs
    @Dan-tg3gs 3 роки тому

    When user enters password for salted password, is there an unhashing algorithm to be able to check if the salted pw in the DB matches user input? Or how is it checked?

  • @Andrei-ds8qv
    @Andrei-ds8qv 5 років тому +3

    THAT WAS AWESOMEE SO CLEAR!! THANKS

  • @RishabhiVlogs
    @RishabhiVlogs 2 роки тому

    Can you please provide an example in java for salt and pepper implementation

  • @UROMSTXY
    @UROMSTXY 7 років тому

    what about double or triple Hashing ? ( Is it a good, or dumb idea )?

  • @nickknight1488
    @nickknight1488 7 років тому

    Your videos are fantastic. Excellent content and production. Like "Crash Course" but in hacking.

  • @MultiMunding
    @MultiMunding 4 роки тому +1

    Pepper is just a global password according to Wikipedia