Bcrypt & Password Security - An Introduction

Поділитися
Вставка
  • Опубліковано 20 лип 2024
  • A conceptual introduction to bcrypt and why it's useful in the context of user password security.
    MakerSquare | mks.io/learntocode
    MakerSquare is a three-month full-time career accelerator for software engineering. By teaching computer science fundamentals and modern web languages like JavaScript, we prepare students to join top flight engineering teams.

КОМЕНТАРІ • 274

  • @nyzss
    @nyzss 3 роки тому +1268

    nice video, and also hello fellow mangadex users.

  • @swarnavopurkayastha4489
    @swarnavopurkayastha4489 3 роки тому +587

    Views are gonna go stonks, now that mangadex promoted it

  • @aminakay8
    @aminakay8 3 роки тому +114

    This was actually really interesting. Thanks mangadex 😂

  • @rierier1
    @rierier1 3 роки тому +143

    Came because of mangadex, stayed because of the easy to understand explanations. I can foresee myself coming to this channel a lot 😲

    • @Ajay-ox1eo
      @Ajay-ox1eo 3 роки тому +2

      It's dead tho.

    • @kandigloss6438
      @kandigloss6438 3 роки тому +2

      It doesn't seem to be active tho and even when it was active it seemed to be a mix of conferences and someone's garbage bin, this seems like the most useful thing on it. Nice to have this though since clicking around all the other videos on this are needlessly complicated (one even turning "what is plain text?" into a drawn out and complicated explanation, wtf)

  • @user-mv5tx8bb2t
    @user-mv5tx8bb2t 3 роки тому +302

    whew, im safe. my password is way too weeb to be in any dictionary.

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

      same

    • @markjohnston6974
      @markjohnston6974 3 роки тому +75

      Joke's on you, the hackers are weebs, too.

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

      meaning?

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

      Mine's too personal so it might as well be random

    • @mqbaka
      @mqbaka 3 роки тому +5

      problem is, if one of mangadex user uses a password that he has in his dictionnary, he would be able to find all the other passwords using their hash. He just has to find one match to get all the others (I guess, the video does'nt make that point very clear but, I assume that is the way it works)

  • @man_lady8510
    @man_lady8510 3 роки тому +34

    i get none of this but i feel safer now thanks mangadex

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

      From what I understand:
      "abc123" + "salt" => [bcrypt] => "ab7qru.."
      Salt can be any string of characters and is protection against dictionary attacks (hackers generate a dictionary of common passwords and test it against the database). Generally, salt is unique for each user taking account their join-date, their age, etc. If we take that into account, it can turn into:
      [salt] = [join date] + [age] ^ 2
      [password-digest] = bcrypt([password] + [salt])
      TLDR = It takes a long time to decrypt a single password from a single account.

  • @kennethjor
    @kennethjor 9 років тому +64

    Nice explanation of password hashing and salts, but I have to admit I came here looking for an explanation of bcrypt specifically.

  • @ashwanishahrawat4607
    @ashwanishahrawat4607 3 роки тому +2

    Cartoon > Animation > Anime > OPM > Mangadex > Hack Reactor
    Great Journey so far, learned a lot.

  • @van2297
    @van2297 3 роки тому +39

    Mangadex users👀

  • @kurama4785
    @kurama4785 3 роки тому +5

    Thanks for the video and i want to thank MangaDex team for introducing me to this channel

  • @PantsStatusZero
    @PantsStatusZero 10 років тому +33

    A dictionary attack is specifically a brute force attack using dictionary terms. A look up table of hashes is know as a rainbow table. Some rainbow tables are produced using a dictionary attack. A salt should be unique to each user. Salts make it hard to produce a rainbow tables because you would have to create a different rainbow table for every possible salt. So it's every possible password times every possible salt.

  • @SirLightfire
    @SirLightfire 3 роки тому +6

    Something he didn't mention is that you typically generate a salt _per password_. That means that generating the hash dictionary (or "rainbow table" as they're typically called) is impossible to generate in the first place.
    This means that cracking each password is _even slower_ because two users who have the same password, will have different password digests, because they have different salts

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

    Thanks for this video. I finally understood how bcrypt works, especially the part about salts. One of the main advantages of bcrypt is that it cannot go obsolete as computers become faster because you just have to increase the number of rounds of hashing.
    When first released in 1999, the recommended number of rounds was 2^6...not you should use 2^15 for increased security.

  • @IsaacFoster..
    @IsaacFoster.. 3 роки тому +18

    I just wanted a site to read some manga , how did I get here lmao

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

    Thank god I read JOJO with no email in mangadex. Nice video btw.

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

    The best explanation i have watch on Bcrypt functionality. Thanks

  • @jaycela900
    @jaycela900 3 роки тому +13

    I'm here bcoz of what happened to mangadex,..😭😭😭😭

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

    This answered my questions and then some, thank you!

  • @Abdulaziz_turki
    @Abdulaziz_turki 3 роки тому +9

    From mangadex✌🏻

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

    Awesome explanation, it all make sense for me now

  • @FeliJz
    @FeliJz 8 років тому +2

    Awesome explanation!

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

    Nice Explaination. Thank You.

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

    Great explanation!

  • @AbhiKhatri
    @AbhiKhatri 8 років тому +5

    Hats off to you man, I really liked your explanation. I am gonna share this to the dev community. :D

  • @23o8idlnqdolkqd
    @23o8idlnqdolkqd 2 роки тому +2

    A BCrypt hash includes salt and as a result this algorithm returns different hashes for the same input..

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

    Very good explanation, thank alot

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

    Thanks for a great explanation!

  • @DZatheus
    @DZatheus 3 роки тому +7

    Ok, so Mangadex is using an enigma machine. Got it.

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

    Please change the title to hashing and password security. "bcrypt" in title is misleading, I thought it explains about bcrypt working!

  • @idontwannagetbanned
    @idontwannagetbanned 3 роки тому +5

    dont feel as scared about the mangadex leak now

  • @yuunayunohana9920
    @yuunayunohana9920 3 роки тому +3

    This video makes it seem like you use a single salt for all users, which you must not do! Instead you should give each user their own random salt and store it with the user in the database.
    That way an attacker has to create a separate dictionary for each user. Additionally, same hashed passwords are different for different user. So even if Alice and Bob use the same password, this is then not apparent in the database because the hash still differ.

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

    Subscribed. Very clear and simple explained!!!

    • @AndyThomasStaff
      @AndyThomasStaff 5 місяців тому +1

      you were lied to. this video is garbage

  • @kueapel911
    @kueapel911 3 роки тому +8

    haha jokes on the mangadex hackers, my password was already leaked along with my username on compromised password list.

    • @AJ-po6up
      @AJ-po6up 3 роки тому +1

      Exactly, mine has been leaked and in the wild since 2010, so it's old news! there's nothing of value behind that password.

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

      @@AJ-po6up even if they try to use it on other website, the most they'd get out of it would be some edgy comment list I made years ago. Nothing of value was lost. That's why I always use my leaked password for non crucial websites lol.

  • @fawazaljohani8447
    @fawazaljohani8447 3 роки тому +3

    My 4 months security class in 7 minutes

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

    Awesome !

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

    Shit now i dont Remember what my password to mangadex was :/ Is three any way to show it now?

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

      if your on chrome go to settings then passwords

    • @AJ-po6up
      @AJ-po6up 3 роки тому +3

      it's 2021 use a password manager goddammit!

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

    Great video, thanks!

  • @cleave4667
    @cleave4667 3 роки тому +7

    this man must be confused with the mangadex comments

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

    So bcrypt uses a pepper to slow down the hashing process?

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

    thanks a lot ❤️❤️

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

    I want to know how a website or app that has the hashed passwords let someone in.
    For example, the pw abc123 is hashed into jibberish, how does the database recognize the hash?
    I feel like I can guess that the pw you sign in with gets hashed the same way, so that when the hashed pw gets compared to the database one it lets you in.
    I would appreciate someone letting me know how it actually works.

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

      That is basically it. When you log in the app will encrypt the entered password and compares it with the stored password hash. If they match, the user entered the correct password. In the case the salt gets somehow changed, users will not be able to log in anymore as it will produce different hashes as the stored password hashes did not change.

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

    in 6:00, why hacker compromise the password will compromise the salt? And how can hacker compromise the password??

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

    Hello just a thought to my self, what will happen if we encrypt both email and password before storing it in the database?

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

    I'm pretty sure it's slow because it probably uses multiple Salts before and after the hash and is unique for every user other than that if one found out about the Salt well then wouldn't the entire Bcrypt database be comprised?

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

      BCrypt uses a single per-user salt. You just hash it over and over again to slow the hashing process. The salt is actually embedded in the hash itself with the work factor (Format looks like $bcryptVersion$workFactor$saltHash) so you do have the salt for everyone. But that means you can't bruteforce all your database with that salt, only a single user.

  • @theswedishdude1
    @theswedishdude1 3 роки тому +3

    so if you use an uncommon password then they wouldn't have it in their dictionary and you'd be safe?

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

      No, it should be unique. Like a project/operation name, with numbers (birthday date, or other for you meaningful dates).

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

    THANK GOD I USED A GOOGLE RECCOMENDED PASSWORD

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

    Very nice.

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

    So if your password isn't a horrible password in the list of the hackers' dictionary attack does the dictionary attack not work? The dictionary attack only works for passwords that they would test against?

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

      Yes...ish. Their list of 'common passwords' likely approximates 'every leaked password ever'. It's just text, the space and power to store it and run through it is negligible.
      If your password is literally unique in the universe, then yes, a dictionary attack would not work against it. If your password is an 8-letter English word, it almost definitely is on the dictionary. So anyone thinking 'my password is secure because it's not on the Top 10 Most Used Passwords List' is kidding themselves.

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

    Estou saudade mangadex! 😢🤗❤

  • @markmiller8080
    @markmiller8080 8 років тому +1

    This is an awesome explanation!

  • @Nasa1423
    @Nasa1423 3 роки тому +2

    I feel personally attacked... Thanks for the explanation tho.

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

    Nice explanation.

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

    Storing Hash (password + static salt) = HASHnew (lets say) in database is a bad idea. If the database is compromised, the attacker can use that static hash value (i.e.HASHnew) and pass it through MiTM to get authenticated.

    • @Yo-yx8wo
      @Yo-yx8wo 4 роки тому

      salt is not static but random

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

    What is the difference between hashing algorithms and functions?

  • @user-mq5nl6sm5y
    @user-mq5nl6sm5y 7 місяців тому

    amazing!

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

    i feel so smart now thank you

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

    exceeded my expectations

  • @re-blitz
    @re-blitz 3 роки тому

    They made a api but I can’t use it cause I can only read on mobile at the time and idk if the website is going up anytime soon :(

  • @jocasteins4309
    @jocasteins4309 3 роки тому +2

    The Last video is 5 years ago quite sad but it is good to know this channel thanks to mangadex

  • @belajarit-65
    @belajarit-65 Рік тому +1

    ohh, the reason is really-really great and so funny for me 😂😂

    • @AndyThomasStaff
      @AndyThomasStaff 5 місяців тому +1

      don't share your worthless thoughts

  • @ahmadalmoustafa
    @ahmadalmoustafa 8 років тому +2

    Thanks , great explanation

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

    The difference is... never use MD5 ;)

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

    Very clear thanks

  • @samandarshoyimov5580
    @samandarshoyimov5580 19 днів тому

    nice, very informative

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

    Thank you sir

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

    Nice video good that i used a dumpster mail for mangadex but not so good that i don't have access to the dumpster mail anymore after their hack.

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

    Isn't that a rainbow table? I thought a dictionary attack was when you bruteforce using common words instead of individual characters.

  • @paulinebunuan
    @paulinebunuan 3 роки тому +2

    Where do you read your manga now?

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

      Mangasee ig

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

      I used to read from the scanlators' respective websites, but I recently found Manganeko.net and it has no ads so its pretty good.

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

    It means that the mangadex uses good program to store our database

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

    tysm

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

    But if I didn't sign up to the website and the website got hacked then am I safe or not?

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

    yes hello from mangadex

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

    this is in fact not how bcrypt works. it works as a general idea on securing passwords, bcrypt uses a chained key generator accessing pseudorandom memory addresses to set up for generating the hash. the salt is not appended or prepended to the password string but instead used to set up the key generation.

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

      so the part he got wrong is just how the salt works then?

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

    Does bcrypt uses salt to hash password ?

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

    So, This means that i dont have to be too scared about my password on mangadex?

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

      A simple password change should be safe, unless you use the same password in other websites, i suggest you change them all if ever the breacher decides to expose the info.

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

      @@kanoccino or 2FA; if the website does not have that then just do what Kael H is saying.

  • @GabeFromUtah
    @GabeFromUtah 8 років тому

    Very impressed with this presentation. You are quick with the tablet?

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

    Video: but bob is not so smart
    Me: oh that's me

  • @90OiNoTnA
    @90OiNoTnA 3 роки тому

    So should I change the pwsord?
    So I enter the mangadex?

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

      what do you mean?

    • @90OiNoTnA
      @90OiNoTnA 3 роки тому

      @@vampante that is, I did not understand well.

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

    I came to know about algorithm of bycrypt hash but I didn't found anything that helps me you only told what every hashing algorithms do I know more on that this is not bcrypt

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

    Slightly off topic but
    As a mangadex user, is there anything i should do??

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

    what if you hash the hash and the salt?

  • @Jmaasy
    @Jmaasy 9 років тому +1

    Nice and clear explanation

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

    I think he will promote l@st pas😆 for storing password but I'm wrong when look at the videos upload times.... 😄
    I'm glad...

  • @oceanmeme5475
    @oceanmeme5475 3 роки тому +3

    i just wanted to read part 7

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

      I was panicking because i thought I couldn't read the new part 8 chapter

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

      thank god i read it on mangadex a year ago

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

    Why didn't I know about this in my college days?
    Now I feel like an idiot using md5 to encrypt my projects...

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

      Depending on how old you are, md5 would've been fine for the computing power of the day

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

    turn on 2FA, it's a pain to use it every time but it works

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

    simplified

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

    Imagine suddenly getting views flood because manga website recommends your video :)))

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

    but, why is it slow? what makes it slow? and how by being slow makes it good?

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

      I think he means the hashes are more complex and longer, therefore slower to generate. imagine if md5 takes the original string and turns it into a hash after 10 steps. Bcrypt turns it into a hash after like 50 steps.
      therefore for a list of the Dictionary Hash (assuming the hacker tries to make one that has a list of top 10,000 common passwords for example) it becomes like 50,000 times LONGER to generate the whole dictionary hash. imagine if the md5 dictionary hash it takes 1 minute to create and for bcrypt dictionary hash takes 50,000 minutes or a whole month. That's an insane difference.
      take this with a grain of salt ( _haha_ ) since I'm not a code-person but I think that's pretty much it

  • @Dominus_Potatus
    @Dominus_Potatus 3 роки тому +2

    5:18 so... basicly it is like elimination in algebra, hahaha

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

    2021 here.

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

    Okay, so it's "designed" to be slow, but how does one do that? Surely it's not as easy as inserting a ton of WAIT clauses or somesuch that someone else compiling the algorithm for themselves could just take out and/or something easily alleviated by throwing ever more computation power at it thanks to Moore's, right?

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

      The hashing algorithm takes computational work, which takes time. It's designed to be slow by just doing more and more computational work, the attacker knows the exact computations he needs to do to get the same hash, but he needs to do it on every password he tries to guess.
      So if the computation takes 10 seconds, then each guess of his will cost him 10 seconds which he will have to go through for each of his guesses.

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

      @@jellyrabbits375 Appreciate the response, but it didn't actually explain anything. Just said the same things with different words.

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

    stonks

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

    Why BCrypt is better 6:02

  • @senkuayano4937
    @senkuayano4937 3 роки тому +2

    i came here from mangadex

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

    My overthinking saved me this time.

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

    I am Bob.

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

    But really, mangadex. This is the first time that I signed up to a website and got hacked where our PWs and IPs were leaked. How careless of them.

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

    70k

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

    I did not plan to do this but my mangadex gmail acc is the same as my facebook gmail lol and someone tried to change my password, jokes on you hacker, for every site I use a different password even I forget about them

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

      lmao tbh relate, I've lost like 30% of accounts I've made as a kid on kiddie flash game websites