Das Video kommt von YouTube: erst beim Abspielen verbindet sich die Seite mit YouTube (Google).
PHP password hashing explained
Das Wichtigste aus dem Video
Tipp auf eine Zeit – das Video springt genau dorthin.
Transkriptautomatisch erstellt · 21 Zeilen
- hello hello again everybody today I'm going to be explaining hashing in PHP hashing is the process of transforming sensitive data such as a password into
- letters numbers and or symbols via a mathematical process it's kind of similar to encryption but it's technically different basically speaking
- we can hide sensitive data from third parties like hackers in my example I have hashed my password pizza123 this is what my hashing
- algorithm spat out it appears to be what looks like a bunch of random letters numbers and symbols we might store this in a database that in case that database
- is compromised well then a third party wouldn't be able to see my original password this is what the third party would see in PHP to create a hash of
- let's say a password I'll create a password variable make up some password
- Pizza one two three I will create a hash variable then use the password hash function
- the two arguments are a password then a hashing algorithm the second argument is technically a constant that specifies the algorithm the constant
- will set is password default if we set our algorithm to be password default and PHP currently we're using the bcrypt algorithm which is a very
- popular algorithm this hash is what we'll be storing within a database it's protected if I were to Echo my hash this would be the result
- our password is what is referred to as plain text we can plainly see what it is using the password verify function we can compare a password versus a hash if
- they're mathematically similar then that password verify function will return true let's write a if statement if
- password verify then we'll pass in a password and a hash let's say that we get some user input the user types in hamburger 666.
- then the other argument is going to be our hash just imagine that we're retrieving this hash from a database if our plain text
- password and our hash are mathematically consistent then this function will return true so let's Echo
- you are logged in else Echo incorrect password
- okay is hamburger 666 the same as our hash incorrect password what about hot dog one two one two
- that is also incorrect maybe pizza one two three oh look at that that's the right password you are logged in
- the password verify function will verify a plain text password versus a hash if there's a match we return true if not it returns false that's really what hashing
- is in layman's terms it's transforming sensitive data such as a password into letters numbers and or symbols via a mathematical process and the purpose is
- to hide the original data from third parties and that is how to Hash a password in PHP
Zum Nachlesen
Salt (Kryptologie)Salt (englisch für Salz) bezeichnet in der Kryptographie eine zufällig gewählte Zeichenfolge, die an einen gegebenen Klartext vor dessen weiterer Verarbeitung ( …
SchlüsselableitungDie gebräuchlichste Verwendung von Schlüsselableitungsfunktionen ist der Passwort-Hash bei der Passwortverifizierung. Schlüsselableitungsfunktionen weisen …
Rainbow TableJede dieser Ketten startet mit einem initialen Kennwort, welches durch eine Hashfunktion geleitet wird. Der resultierende Hash wird wiederum durch eine …
Message-Digest Algorithm 5Message-Digest Algorithm 5 (MD5) ist eine verbreitete kryptographische Hashfunktion, die aus einer beliebigen Nachricht einen 128-Bit-Hashwert berechnet.