Password Storage Tier List: encryption, hashing, salting, bcrypt, and beyond

  Рет қаралды 253,292

Studying With Alex

Studying With Alex

Күн бұрын

If you're building an app or product, you need to store your users' passwords securely. There's terrible ways to do it, like storing them in plaintext or encrypting them, slightly better ways like hashing or hashing and salting, and even better ways like bcrypt, scrypt, or argon.
Sources:
gist.github.com/epixoip/a83d3...
github.com/corkami/collisions...
00:00 Intro
00:26 F Tier: Plaintext
00:55 D Tier: Encryption
01:50 C Tier: Hashing
05:22 B Tier: Hashing + Salting
06:55 A Tier: Slow Hashing
08:45 S Tier: Don't Store Passwords
09:18 Recap

Пікірлер: 734
@4Bakers
@4Bakers Жыл бұрын
I've seen worse than storing in plain text. I once ran into a website that stores your login credentials (email and password) *IN THE URL*
@Daniel_WR_Hart
@Daniel_WR_Hart Жыл бұрын
I had one store my credentials on my machine in a plaintext file in the appdata/roaming/Mozilla directory
@jellyinmabelly
@jellyinmabelly Жыл бұрын
lmfao alot of times they focus on the design and other stuff while forgetting about security
@AnxiousFrenchFries
@AnxiousFrenchFries Жыл бұрын
oh my god it's exactly same case for one of the games I play. They use HTTP connection to an IP address that doesn't even have a domain name, it's just plain IP address, and worse thing is they put both email and password in the url... I mean I'm not even that good at web development and security but I know that is like the most insecure way of doing it
@-_lIl_-
@-_lIl_- 11 ай бұрын
thats because there is a really really old feature that allows you to login from a URL, and even though the dumbness of this is beyond my understanding, it is still A WORKING FEATURE in most browsers.
@-_lIl_-
@-_lIl_- 11 ай бұрын
thats a Z tier
@WackoMcGoose
@WackoMcGoose 9 ай бұрын
The "use a third party auth system" has a massive asterisk on it, though: it depends on WHICH third-party auth system you use. Forcing your users to sign up for Facebook just to access your website puts you straight down to Z tier on principle.
@replikvltyoutube3727
@replikvltyoutube3727 9 ай бұрын
It's also single point of failure
@jnharton
@jnharton 9 ай бұрын
In that respect it's no /worse/ than doing it yourself.
@WackoMcGoose
@WackoMcGoose 9 ай бұрын
@@jnharton No no, "either Sign In With Facebook or don't use my site at all" is _significantly worse_ than even storing passwords as plaintext. If you give your users _multiple provider options_ for third party auth, then you're fine.
@TheMR-777
@TheMR-777 9 ай бұрын
When we use a Third-Party Authentication service, that service produces an Auth-Token which is stored for the session user is logged-in the device, and has some expiry to it. So, it's something like a password, and that auth-token (which acts as a password) is reset after each session.
@lemonlordminecraft
@lemonlordminecraft 9 ай бұрын
I enjoy multiple third-party authentication options up until the point that I have to implement them. Polymorphic database rows are... unclean...
@__christopher__
@__christopher__ 9 ай бұрын
Another point: Don't store the authentication data in the same database as the application data. That way if you have an SQL injection vulnerability in the application code, the attacker still can't read the authentication data (because the SQL doesn't run on that database).
@warny1978
@warny1978 9 ай бұрын
More than that. Split your authentification system from your application. That what's done with Google or Microsoft or any external authentification. What you just need to know is if the authentication system really have authenticated your user. For that purpose, it has to emit an authentication ticket that it signs with a private key. You can verify that signature with the public key of the authentication system, guaranting the emiter identity.
@__christopher__
@__christopher__ 9 ай бұрын
@@warny1978 if your website only allows me to login using one of the big companies, I likely won't ever log into it.
@futuremapper_
@futuremapper_ 9 ай бұрын
@@warny1978yet msft still gets hacked
@vincenttjia
@vincenttjia 9 ай бұрын
Yeah basically have an api for your api, that way only an RCE or SSRF will work Might be able to do some rotating api key auth though for the SSRF
@fischi9129
@fischi9129 9 ай бұрын
if you have an SQL Injection in the first place you probably fucked up....
@diego_samano
@diego_samano Жыл бұрын
You miss to point out the disadvantage about using third party authentication methods. That is that security breaches are out of your control. It's likely that attackers try to break into big companies rather than attack unknown companies. Then use that information to propagate the attack. Security is definitely a big challenge.
@WhyFi59
@WhyFi59 Жыл бұрын
I feel like S Tier should be using multi-factor authentication on top of A Tier, for the exact reasons you described.
@master74200
@master74200 Жыл бұрын
@@WhyFi59 Absolutely. Using secondary factors, especially physical ones, will make it MUCH harder to do non-targeted attacks.
@qichengu207
@qichengu207 Жыл бұрын
How can you trust "them" at all??!!
@master74200
@master74200 Жыл бұрын
@@kishirisu1268 You really should not be using SMS as a secondary factor. Sure it can be a secondary factor, but it isn't _really_ something that you have, in the way that simply using an authenticator app like Google Authenticator og FreeOTP or Aegis is. Even better would be using a hardware key with biometric authorization. But that's to make targeted attacks difficult. If someone is physically at your location, holding you hostage, then nothing will help you.
@UtkarshSinghPaliwal
@UtkarshSinghPaliwal Жыл бұрын
I think the main advantage of this route of using a 3rd party authentication method like signing with Google will be as described by the video that you get to sleep in peace. Even though the 3rd party SAMLs are not immune to attacks, the responsibility of losing the passwords of your users will not come upon you rather will be upon Google for this example. Sharing my 2 cents of what I've believed since years: No lock is one such which cannot ever be broken, you only need a bigger hammer.
@eruhinmakhtar9162
@eruhinmakhtar9162 9 ай бұрын
There’s another technique called a pepper where you basically have a single extra salt that is stored separated from your database that then gets applied to all passwords (sometimes applied in obfuscated source code). The benefit to this is that it makes your database functionally resistant to dictionary attacks because the attacker does not know the pepper and thus will never be able to match a hash
@brooklyna007
@brooklyna007 9 ай бұрын
We pull the pepper from a credentials storage that is separate from the database credentials storage but is used at deploy time only.
@Dc4nt
@Dc4nt 9 ай бұрын
Peppers are a headache to manage. You cannot rotate them, since you don't have the original passwords to regenerate the hashes. One leak and it becomes a dead weight, so you end up being way more careful about its storage and access for a questionably small gain in security over slow hashes.
@brooklyna007
@brooklyna007 9 ай бұрын
@@Dc4nt They are very useful against SQL injection attacks and database hacks which are very common. It makes reading your database pointless. You can rotate them with a small effort. You rotate them using 2-3 versioned password columns. Users eventually have to login with their password again. Then is when you re-pepper and store it under a new version. After a short while you can invalidate all logged in sessions and re-pepper for any user logging in again. Most invalidate logged in sessions within a few days anyways. Upon breach you can invalidate them all in an hour.
@Dc4nt
@Dc4nt 9 ай бұрын
@@brooklyna007 I suppose what I'm trying to get at is whether the operational overhead of working with peppers is worth the added protections they provide. Sure you can build in enough infrastructure to make rotation feasible, get it to a state where you might even call it "easy", I just don't think it's worth it when you can just import bcrypt, write a few lines of code, and be better than most homegrown systems from the past 2 decades.
@brooklyna007
@brooklyna007 9 ай бұрын
​@@Dc4ntI can understand the reluctance. But remember that GPGPU vs CPU power isn't scaling together. The current suggest bcrypt settings take a bit over a second. That is already a bit of an issue if you're loading a lot after sign in. In short time the strategy might not be feasible. So adding that pepper infrastructure is a way to keep the settings at a sane speed so people can sign in at a reasonable speed while adding protection for more common attacks.
@stand355
@stand355 Жыл бұрын
G Tier is to "open source" the password database contents in plaintext.
@RV2O
@RV2O 9 ай бұрын
then some mf makes a pull request 😈
@tardistrailers
@tardistrailers 9 ай бұрын
I once had a website just randomly dump the user database, including e-mail adresses and plaintext passwords, at the bottom of the page in json encoding. 💀
@humilulo
@humilulo 9 ай бұрын
H tier is to hard code passwords in the source code. 😂 I've seen this too!
@immortalnub
@immortalnub 8 ай бұрын
I Tier is storing the pws in source code. H tier is storing the encoded pws.
@itistheworstchannel
@itistheworstchannel 8 ай бұрын
J tier is showing all the passords on the login / signup page
@catten8406
@catten8406 9 ай бұрын
2:44 I feel that another analogy could be useful to some who are still confused on how hashing functions are completely irreversible. Here's one I found someone on stackoverflow but can't remember the original post. Imagine you are making a hash function. You take a string input named S. You return the length in characters of S. For example, if I input the string "cat", you would get the number 3 back. There is no way to turn 3 back into cat, they have no relation. This happens at a far more complicated level in hashing, where there isn't a way to go backwards, because the hash algorithm removes any useful information. The example hashing algorithm shouldn't be used if it wasn't already obvious, because of the collisions.
@lekhakaananta5864
@lekhakaananta5864 9 ай бұрын
I think the simplest explanation is that it's "one way" because infinite inputs can result in the same output, therefore if given a output, you cannot find out which one of the infinite possible inputs it came from. In your example with "cat" -> "3", it's "one way" because there are more than one 3 letter combinations that would result in "3". Of course, if this were the only property we needed, then we can have a more extreme "algorithm" that returns the same output no matter what you input. Note that this indeed makes it impossible to figure out the input from looking at the (constant) output. Hash algos in practice have more constraints, one of which is that we actually want to have most expected inputs to produce different outputs. Yet the prior constraint must remain; every output must still have infinite possible inputs. This may sound like a paradox but it is actually not. The nuance that allows this is the word "expected". We want different inputs that are actually used to produce different outputs, while each output can potentially come from infinite inputs, but those would not be the ones we statistically encounter. Therefore the hashing algo strikes a balance between getting inputs to produce the same output vs getting them to produce different outputs. (same output is what we call "hash collision") The result is the combination of desirable properties: we can distinguish different inputs by looking at their outputs (most of the time), but we can't literally inverse the function to get inputs from outputs.
@catten8406
@catten8406 9 ай бұрын
Well said.@@lekhakaananta5864
@jnharton
@jnharton 9 ай бұрын
The important detail here is that completely unrelated inputs can produce the same output. Imagine if 'cat' and 'dog' both result in '3'. Other than the inputs being composed of characters from the latin alphabet and having the same length, they have nothing in common. So knowing the output tells you virtually NOTHING about the input
@hrishikeshaggrawal
@hrishikeshaggrawal 9 ай бұрын
perfect example my fellow cat enthusiast
@brooklyna007
@brooklyna007 9 ай бұрын
I usually get people to imagine adding up the places in the alphabets of each letter times their place in the sentence. So for "cat" it is 3*1 + 1*2 + 20*3 = 65. That makes it more intuitive why collisions are hard to find. But then you have a word like "gale" that is hard to find but hashes to 7*1 + 1*2 + 12*3 + 5*4 = 65 as well. So is 65 "cat" or "gale"? Then I mention fixing the output size by taking the remainder when divided by the fixed size and mention how that allows infinitely many such collisions if we consider all possible strings.
@okaro6595
@okaro6595 Жыл бұрын
Without salting they can attack the whole database at once. The weakest will surely break. With salting they need to attack each user separately.
@jan-lukas
@jan-lukas 9 ай бұрын
THIS
@brooklyna007
@brooklyna007 9 ай бұрын
In other words the amount of compute effort is multiplied by N where N is the number of users.
@jnharton
@jnharton 8 ай бұрын
It really depends on exactly what the situation happens to be. If someone can compromise the whole server via figuring out admin credentials or through a software exploit, you might be thoroughly fucked. Salting helps the most when the attacker has only the usernames and the encrypted passwords, because "reversing" the hashing algorithm isn't terribly helpful if everyone used a different salt. Having the salts and knowing the algorithm could expose the credentials' security to a dictionary attack. It would be a lot of work, though.
@brooklyna007
@brooklyna007 8 ай бұрын
@@jnharton Salting always increases the effort to hack from a mathematical point of view/. If you only have access to a database or database table then peppering can do a lot. If you've compromised the whole system peppering is useless.
@macethorns1168
@macethorns1168 8 ай бұрын
@@brooklyna007 Yes.
@ItsaDigitalHamster
@ItsaDigitalHamster 9 ай бұрын
SHA1 and MD5 were proved insecure because algorithms were found to generate hash collisions (where two messages have the same hash) more efficiently than by brute force. This reduces the work an attacker would need to do to find something that hashes to your password, which allows them to break in. However, it's not just about having a foolproof hashing algorithm - newer algorithms have also always generated hashes of ever growing length. As computing power has exploded exponentially, what was unbreakable 20 years ago is now possible to crack in reasonable time just by trying all the possibilities. So it's not just these two. All encryption/hashable algorithms that would have been fast enough to be practical a couple of decades ago, are now small enough to be breakable on modern hardware.
@GnomeEU
@GnomeEU 9 ай бұрын
Those are also greatly exaggerated. I once generated a random password and then did md5 on it. No one at my work place could crack it with any Tool they used.
@jnharton
@jnharton 9 ай бұрын
It's worth noting that many of those hash functions are pretty useful for checking downloaded files. They easily detect file corruption, bad downloads, and make maliciously altered files much less successful. Sure, there might be a handful of collisions, but it's still tricky to produce a file that has the same hash and still be able to sneak in malicious alterations.
@ultimaxkom8728
@ultimaxkom8728 9 ай бұрын
@@GnomeEU Woah, your work place is the whole world?! That's crazy.
@GnomeEU
@GnomeEU 9 ай бұрын
@@ultimaxkom8728 wanna bet 100 bucks that you can't crack my md5?
@fakestory1753
@fakestory1753 9 ай бұрын
it is wrong to say all hashing will eventually fail due to ever growing computation speed, since it is very easy to increase breaking cost than advance computer technology how good will the computer be when we are already close to single atoms? maybe a trillion times faster in future? or another trillion times after that? it is useless to against a hashing that takes 10^100 more effort to break in, you can even make it harder if you want i feel the weak point is always weak security system and weak passwords or leaking your password
@Mothuzad
@Mothuzad Жыл бұрын
You made this video so well that I still watched the entire thing despite already knowing all this and having implemented a slow-hashing-based password system. Gotta love a good proof-of-work use-case!
@Dorumin
@Dorumin Жыл бұрын
As opposed to the bad ones :)
@Mothuzad
@Mothuzad Жыл бұрын
@@Dorumin I'm sure I could generate arbitrarily many bad use-cases. Like, making sure you REALLY REALLY want to open a file by applying many iterations of encryption to every individual file on your disk. If you really need to load that executable, you can wait a couple minutes, right? And that config file, same deal? Actually, I might love awful use-cases too....
@SimonClarkstone
@SimonClarkstone 9 ай бұрын
Also: peppering, client-side certificates, or certain protocols that doesn't ever send the user's password to your server.
@jnharton
@jnharton 9 ай бұрын
Thr last one is just 3rd party authentication.
@Noxxet
@Noxxet 9 ай бұрын
​@@jnhartonnot necessarily, you can utilize zero-knowledge (ZK) protocols, look into the Socialist Millionaire Protocol (SMP)
@executesquid8779
@executesquid8779 9 ай бұрын
@@jnharton If the hash algorithm is know AOT, you can salt, hash, whatever else client side, and then send that to the server, so the server never gets the plaintext password in the first place (really though you need the server to then hash (+ salt, whatever) the hash it got from the client, so if the client is spoofed to give a doctored hash (equal to one cracked from the server) it would be hashed again and still be wrong (eg. double hash the password, once client, once server))
@insu_na
@insu_na 9 ай бұрын
SRP6a does the last of these. The password never leaves the client, so even if the server is taken over completely by a malicious actor they can't get your password, they can only know if you used the correct password, but they can't know what you used. It's pretty dang cool
@mohamed-hassan-
@mohamed-hassan- 11 ай бұрын
Excellent video with a simple explanation, the simple example you talked about Hashing is AMAZING - the brown color - it's just a smooth, attention-grabbing and not boring at all video, keep up with your good stuff
@Relkond
@Relkond 9 ай бұрын
Google and Facebook both have their own passwords - switching to them doesn’t make the problem go away - it just pushes the responsibility on someone else, which is not a solution.
@ArtemShoobovych
@ArtemShoobovych 9 ай бұрын
One more architectural way to store credentials (not necessarily passwords) is to store them in a separate database which is only accessible by other systems, so there are no credentials for the database to speak of. This requires a third "party" in communication between systems, which manages accounts and credentials and rotates them (generates new credentials) periodically, called Identity Authentication Service (IAS). This is widely used in cloud systems (AWS, Google Cloud Platform, Azure, etc).
@scottamolinari
@scottamolinari Жыл бұрын
Also, store the "sensitive" data in its own table. So, when a dev has to get user data, they have to consciously go to another table to get the sensitive data. You can also lock down access to it further, if needed and also have encryption at rest too.
@stephenlee5929
@stephenlee5929 9 ай бұрын
Sounds good, which data is 'sensitive', more importantly which is not?
@jnharton
@jnharton 8 ай бұрын
@@stephenlee5929I would consider sensitive data to include things like first name, last name, geo address. birthdate, elem/middle/high schools, pet names, and anything else that taken singly (or as a cluster) might uniquely identify the user. Such information might plausibly have been used to synthesize a password, build a set of security questions+answers, or be used as a hint or reminder. This could be expanded to include anything you would normally keep private (known only by you, your immediate family, or especially close friends)
@jnharton
@jnharton 8 ай бұрын
@@stephenlee5929Generally speaking stuff like a blog post or comments can be considered public or semi-public and therefore not intrinscially sensitive. The same goes for profile photos, forum avatars, and anything that would normally be shown to any other user without restriction.
@ketkipatil8309
@ketkipatil8309 Жыл бұрын
Crystal clear and to the point explaination in a minimal time.Great work!
@brettwines6812
@brettwines6812 2 жыл бұрын
love the summary at the end! This was so good
@alexhiatt3374
@alexhiatt3374 9 ай бұрын
thanks for the simple explanation, I've heard of salting before but never knew what it meant. now it all completely makes sense!
@minskleo
@minskleo Жыл бұрын
Awesome work, thanks for that clarifications! It's insanely easy to understand using this video. Will suggest everyone who needs to understand how it works.
@willomillo
@willomillo 2 жыл бұрын
Your videos are awesome! I'm speedrunning your channel and I'm learning a lot, awesome content man! Subscribed!
@renanlisboa123
@renanlisboa123 Жыл бұрын
Thank you for the effort put into this video. This is beautiful
@sitronco
@sitronco Жыл бұрын
Fantastic video. Thanks for the hard work of putting this together
@vunu.
@vunu. 3 жыл бұрын
Truth be told, this is your best video yet. Awesome stuff and very well articulated.
@mohamedezz8186
@mohamedezz8186 2 жыл бұрын
ظمك
@MatyGamer1
@MatyGamer1 9 ай бұрын
CS Student here! I liked the video very much because it allows you to understand what is real life password managing without the heavy/complex theory it carries behind! A smooth way to be introduced in the subject. congrats bro
@coffeedude
@coffeedude 8 ай бұрын
Great video to watch as a refresher!
@cliq7513
@cliq7513 9 ай бұрын
This is great! I'm relatively new to computer science and coding and you explained this so well!
@KazeReload
@KazeReload 9 ай бұрын
Really amazing video! It's so clear that everyone could understand it, but still gives the intendend information. Congratulations! New susbscriber gained ;)
@marlinhicks
@marlinhicks 4 ай бұрын
I just really enjoyed the effort and method of communication on the topic. 5 -Stars
@Juliozz3
@Juliozz3 9 ай бұрын
Amazing explanation! You make the subject very easy to understand
@stevesan
@stevesan Жыл бұрын
your videos are awesome. very well animated and explained.
@user-id3fc8qs7y
@user-id3fc8qs7y 4 ай бұрын
Amazing video, you really explain this topic well, using this iterative method of "problem -> solution -> problem -> solution ->..."
@v0id_d3m0n
@v0id_d3m0n Жыл бұрын
this was a very informative and aesthetically-pleasing video :)
@HanniSoftware
@HanniSoftware 5 күн бұрын
Really great video. Especially the cinematics!!
@pixelstriko1642
@pixelstriko1642 Жыл бұрын
this video is really really good, i like how you slowly go up the ranks explaining the problem(s) with the previous one, the only problem i see with this video is the S tier shouldve just been 2fa
@cracktek_industries
@cracktek_industries 9 ай бұрын
That color mixing analogy for hashing is genius. I'm going to use that from now on
@DBagg-zz4ip
@DBagg-zz4ip 9 ай бұрын
Problem with S tier is possibly losing access to the third party account. Big Tech Company might do something stupid like Nymwars again. Compartmentalization is nice; I'd rather have to respond to the occasional website breach than risk everything. Though, that depends on using a password manager right...
@jnharton
@jnharton 9 ай бұрын
In an ideal world, an authentication/identity provider third party would have some way to identify you in the real world rather than simply being an ordinary account from a third part that functions as a master login.
@user-zn3zx6fk7u
@user-zn3zx6fk7u 10 ай бұрын
insanely good content, keep it up! very very very underrated
@alexandrutalvan1340
@alexandrutalvan1340 9 ай бұрын
I really wouldn't sleep better at night knowing I have created a single point of failure for every login I have
@nutterbutter1945
@nutterbutter1945 8 ай бұрын
I'm really impressed by the quality of this video! it's so thorough yet concise!
@harry_kr
@harry_kr 2 жыл бұрын
Such a professional explanation and excellent articulation, how doesn't this have more views??
@MaksMikhnevych
@MaksMikhnevych 2 жыл бұрын
Because you did not bother to share this video on your social media platforms. Instead you put an upsetting comment to the author, do you think this attitude stimulates him?
@harry_kr
@harry_kr 2 жыл бұрын
@@MaksMikhnevych from my point of view it clearly articulates that his hard work produced an excellent video, hence, the view count shouldn't be representative of it's quality. Sorry if it came off as otherwise. My comment got a heart though... so I think it's probably fine :)
@PvblivsAelivs
@PvblivsAelivs 9 ай бұрын
Computerphile previously did the same thing. Look up "how not to store passwords." I think they have more views.
@iluvpandas2755
@iluvpandas2755 9 ай бұрын
Every comment boosts this vid on the algorithm so we are all helping him here :)
@DamianYerrick
@DamianYerrick 9 ай бұрын
@@MaksMikhnevych Not sharing this video on social media might have the same cause as not being able to use S tier authentication: a user might not even have an account on social media.
@preadatordetector
@preadatordetector 8 ай бұрын
You earned a sub. This is educational and digestible!
@user-ko6zc5gl1z
@user-ko6zc5gl1z 2 ай бұрын
What a perfect explanation. Thank you
@DomskiPlays
@DomskiPlays Жыл бұрын
This was a really good video, congrats!
@dawidziu4351
@dawidziu4351 4 ай бұрын
Awesome video and very clear explanation
@Danielo515
@Danielo515 9 ай бұрын
Very good, short and informative video
@MrRubikraft
@MrRubikraft 9 ай бұрын
Extremely useful, thanks!
@yacinelaghmari
@yacinelaghmari Ай бұрын
Really good video dude. Thank you
@jchidley
@jchidley Жыл бұрын
Thank you for a clear explanaition
@geopolitica5106
@geopolitica5106 Жыл бұрын
Thanks a lot for your time to teaching us
@BrotWurst
@BrotWurst 9 ай бұрын
i really like the yellow & dark grey video design. not too bright at night and not too dark in daylight. nice choice.
@MadafakinRio
@MadafakinRio Жыл бұрын
This dude is explaining important shit (which a lot of us were interested in but never bothered to look up) while keeping it ELI5. Good job!
@rohitgarg6059
@rohitgarg6059 10 ай бұрын
best video for understanding how hashing works !!
@pxwxski1337
@pxwxski1337 2 жыл бұрын
Your channel is very underrated, also you got my sub, I hope you will make more vids
@FedericoTrentonGame
@FedericoTrentonGame 9 ай бұрын
Cool video straight to the point and informative :)
@BryanRodriguez-sp2gq
@BryanRodriguez-sp2gq 7 ай бұрын
Awesome explanation🎉🎉
@sany2k8
@sany2k8 2 жыл бұрын
Great content 👍 , subscribed. Please post more valuable contents like this. Thanks in advance
@viniciusnoyoutube
@viniciusnoyoutube 9 ай бұрын
Perfect, great work.
@jamesdanielelliott
@jamesdanielelliott 2 жыл бұрын
You forgot peppering! It's A+C or B+C. Meaning they must both have the asymmetric encryption key and they must break the salted password once decrypted.
@Pietro-qz5tm
@Pietro-qz5tm Жыл бұрын
If you can keep the pepper secure you can also keep the password database secure (just use the secure secret to encrypt the password column). The pepper is more about the security of the database then the security of the stored password. The requirement is that even if an attacker is able to read everything in the system (the database as well as any other stored secret as any pepper or db encryption keys) the stored password should still be useless; assuming an uncompromised secret pepper defeats that assumption in the security requirement. The assumption is reasonable as it is common that the server is eventually compromised. The idea of a pepper can make sense when implemented in hardware: then it is different from encryption because the software layer can not read the unencrypted data but only query for an hash evaluation. In this case a remote attack can not recover useful information (if the hardware implementation does not leak information about the pepper). But in any software implementation a remote attack that can compromise the db can as well compromise the pepper.
@schwingedeshaehers
@schwingedeshaehers 9 ай бұрын
Use if pepper could only lower the length of a salt, but doesn't make it more secure (so you need less storage), if not the case described by Pietro. If it is known, what I think, than it is the same as a salt, but the same salt for everyone. It helps against normal rainbow tables, but with only pepper, you can still generate a rainbow table for this database.
@brooklyna007
@brooklyna007 9 ай бұрын
​@@Pietro-qz5tmBut who would risk losing access for all their users (or at least many users at a time even if things are distributed) based on a single hardware failure? Maybe for an embedded device or for 2FA based on SIM but other than those cases such extreme single-point hardware failure risk would be not be good practice for most modern systems.
@brooklyna007
@brooklyna007 9 ай бұрын
@@schwingedeshaehersPeppers can also protect against sequel injection attacks where access is only to the database and not to credentials because reading the table doesn't give enough data to *even begin* a brute force attack. But if attackers have compromised enough of the system to get the pepper then it adds nothing.
@schwingedeshaehers
@schwingedeshaehers 9 ай бұрын
@@brooklyna007 at depends on how it is designed, but I see currently no way of using it. Your password should be hashed by the time it reaches the DB, which makes every SQL injection with the password part hard, and the pepper doesn't change anything with the user name
@kaungmyatpaing13
@kaungmyatpaing13 Ай бұрын
Very informative. Thanks!
@nvbvi1258
@nvbvi1258 8 ай бұрын
Perfect like usual
@VincentJenks
@VincentJenks 9 ай бұрын
Lololol! Amazing. This is my life right now. It's not even an exaggeration.
@chengjoseph9459
@chengjoseph9459 10 ай бұрын
very Informative and simple to understand.
@sudo-matx
@sudo-matx Жыл бұрын
Great video!
@vindixin
@vindixin 2 жыл бұрын
very informative.. thank you sir!
@KhaiyomOdinaev
@KhaiyomOdinaev Жыл бұрын
The preview of your video was 100% speculative, and yet 200% worth it.
@zacmilioli
@zacmilioli 8 ай бұрын
Thank you, I've learned really important information 🙂
@superdownwards
@superdownwards 9 ай бұрын
So good. Great job
@sulliwan1
@sulliwan1 7 ай бұрын
Technical nitpick: rainbow tables are a method of using less storage for your pre-computed hashes, they can be used with dictionaries with permutations if you choose your reduction function well. But a database of dictionary word: hash pairs is not a rainbow table.
@ariannargesi7249
@ariannargesi7249 Ай бұрын
Very informative. Thank you
@Tu10248
@Tu10248 Ай бұрын
Thanks for sharing knowledge 💫
@nitinbhattacharyya8784
@nitinbhattacharyya8784 8 ай бұрын
This was an amazing video
@degagnemarc
@degagnemarc Жыл бұрын
Thanks! Well explained differences.
@gr.4380
@gr.4380 9 ай бұрын
this is probably the first time I've understood what salting actually does, bravo
@DWJ92
@DWJ92 4 ай бұрын
Thank you this was reaally good stuff.
@user-ql7pw7ld1n
@user-ql7pw7ld1n 21 күн бұрын
fantastic video..loved it
@ostanin_vadym
@ostanin_vadym 7 ай бұрын
Thank you for sharing knowledge
@Kraboobee
@Kraboobee 8 ай бұрын
Loved that xkcd reference
@eladshamai
@eladshamai Жыл бұрын
Congrats for being the best teacher on KZfaq
@meyes1098
@meyes1098 7 ай бұрын
You can also get creative with the salting process. Something I did for a personal project was to get the salt by just hashing the username, and then based on the sum of the base 10 digits in the hash of the salt, the hash itself would be inserted after the SUM'th digit in the password string (looping over if SUM > password_digits), and then hashing it all over again. I also used sha512 for this. It's really not much better than just regular hashing if this algorithm is known to the attacker, but if it's not (and it shouldn't be known lol), then this essentially requires brute force to crack it, because it's a salt technique without a db-stored salt ;)
@shreyashyewale6495
@shreyashyewale6495 Жыл бұрын
Awesome video
@protori
@protori 2 жыл бұрын
Hey man are you planning on making a part 3 of Equity Compensation & Taxes? I found it really useful actually and I'd love to see the 3rd video on it
@StudyingWithAlex
@StudyingWithAlex 2 жыл бұрын
yup, it's coming! sorry for the delay. make sure to subscribe so you know when i release it!
@protori
@protori 2 жыл бұрын
@@StudyingWithAlex Thanks!! Keep up the good work bro, this channel is great so far
@WhiteSiroi
@WhiteSiroi Жыл бұрын
thank you very much, very helpful
@Morexod999
@Morexod999 2 жыл бұрын
Great explanation
@allezvenga7617
@allezvenga7617 9 ай бұрын
Thanks for your sharing
@user-xo4rr5en3e
@user-xo4rr5en3e 8 ай бұрын
wow i finally understand salting thanks bro
@kxhu
@kxhu 9 ай бұрын
extremely helpful❤
@vladislavkaras491
@vladislavkaras491 3 сағат бұрын
Huh... I did not know about slow hashing techniques! Thanks for the video!
@daniclas12
@daniclas12 Жыл бұрын
Thank you so much for this
@ozzyfromspace
@ozzyfromspace 9 ай бұрын
Congrats, this is an S tier video!
@someoneonyoutube181
@someoneonyoutube181 8 ай бұрын
Very nice video
@TRex-fu7bt
@TRex-fu7bt 9 ай бұрын
I love a Tier List as a teaching device.
@michael88704
@michael88704 9 ай бұрын
Correct horse battery staple...great xkcd reference!!!
@bjmmedeiros13
@bjmmedeiros13 9 ай бұрын
Great video! I wish you talked about passkeys (no password at all) in the S tier as well
@ack_
@ack_ 8 ай бұрын
Mike Pound is proud of you
@gaiagba
@gaiagba 6 ай бұрын
Nice. This helped lot
@movax20h
@movax20h Жыл бұрын
You should look into augmented password-authenticated key exchange (PAKE) , one of the older examples (with some support in various libraries, but unfortunately not in web browsers) is TLS SRP. More modern alternatives are AuCPace and OPAQUE. It has additional safety and security guarantees.
@zidaanhayat4648
@zidaanhayat4648 9 ай бұрын
Great video, I think an addon to third-party auth which I see a lot lately is OTPs via phones, I think it's definitely the way forward if we're talking about S tier user authentication
@sa3270
@sa3270 7 ай бұрын
Also, put a version number on the user table for the encryption method used. It can just be a number you assign. That way if you have to change to a more secure method later, existing users can still log in with their existing passwords stored in the old method, and passwords can be automatically and discretely updated to the new method the next time the user logs in.
@karlkastor
@karlkastor 9 ай бұрын
Another way to not need a password is a private key (either a file on you disk or a ubikey). Especially for ssh the recommendation is to not use a password, but just a private key
@SimonClarkstone
@SimonClarkstone 9 ай бұрын
In HTTP, client-side certificates exist too, though they are rarely used.
@macethorns1168
@macethorns1168 8 ай бұрын
Fun fact: a private key is effectively just a looooooooooooooooooooong ass password.
@alexanderpas
@alexanderpas 9 ай бұрын
Actual S-Tier: Use Slow Hashing in combination with encryption, with the encryption key in a hardware token, so the unencrypted hashes are encrypted at rest, which means that if an attacker gets the encrypted hashes, they need to break trough 2 layers of security, while also allowing you to upgrade the security of your stored encrypted hashes, or change the encryption key, without knowing the password itself.
How To Design A Completely Unbreakable Encryption System
5:51
Half as Interesting
Рет қаралды 485 М.
Salting, peppering, and hashing passwords
8:56
mCoding
Рет қаралды 67 М.
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 32 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 54 МЛН
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 53 МЛН
The Unreasonable Effectiveness Of Plain Text
14:37
No Boilerplate
Рет қаралды 591 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2 МЛН
I Tested 7 Password Managers: the BEST of 2024 is…
5:48
All Things Secured
Рет қаралды 153 М.
This is perhaps my favorite password manager for the terminal
11:10
Dreams of Code
Рет қаралды 146 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
how NASA writes space-proof code
6:03
Low Level Learning
Рет қаралды 2,1 МЛН
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,6 МЛН
Hacker Teaches How to Manage Passwords
4:51
Valuetainment Short Clips
Рет қаралды 126 М.
How to Choose a Password - Computerphile
11:33
Computerphile
Рет қаралды 1,2 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 32 МЛН