tanszek:oktatas:techcomm:hash_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tanszek:oktatas:techcomm:hash_functions [2024/10/07 15:26] – knehez | tanszek:oktatas:techcomm:hash_functions [2024/10/07 15:31] (current) – [Storing Passwords with Hashes] knehez | ||
---|---|---|---|
Line 36: | Line 36: | ||
1. **Square the PIN**: | 1. **Square the PIN**: | ||
- | \[ | + | \[ |
| | ||
- | \] | + | \] |
2. Take the middle 5 digits to get a new 4-digit number: **2061**. Only the first and last two digits are retained. | 2. Take the middle 5 digits to get a new 4-digit number: **2061**. Only the first and last two digits are retained. | ||
3. **Square again**: | 3. **Square again**: | ||
- | \[ | + | \[ |
| | ||
- | \] | + | \] |
- | 4. Take the middle 5 digits again to get another 4-digit number: **4221**. | + | 4. Take the middle 5 digits again to get another 4-digit number: **4772**. |
5. Repeat the squaring and digit extraction process **1000 times**. | 5. Repeat the squaring and digit extraction process **1000 times**. | ||
6. Suppose the final result is **6538**. | 6. Suppose the final result is **6538**. | ||
Line 52: | Line 52: | ||
==== Storing Passwords with Hashes ==== | ==== Storing Passwords with Hashes ==== | ||
- | Websites also store passwords using **hash codes**. They don’t store the actual password but rather | + | Websites also store passwords using **hash codes**. They don’t store the actual password but transform it using an algorithm and store the result. |
- | On some websites, you can generate various hash codes for a given password online. For example, the MD5 hash of the code **‘1234’** is: | + | On some websites, you can generate various hash codes for a given password online. For example, the MD5 hash of the code '' |
\[ | \[ | ||
\text{md5}(1234) = 81dc9bdb52d04dc20036dbd8313ed055 | \text{md5}(1234) = 81dc9bdb52d04dc20036dbd8313ed055 | ||
\] | \] | ||
- | Does this mean that storing hashes provides full security? Unfortunately, | + | Does this mean that storing hashes provides full security? Unfortunately, |
- | \[ | + | |
- | \text{hash cracking} | + | |
- | \] | + | |
Unfortunately, | Unfortunately, | ||
Line 68: | Line 66: | ||
1. **Use long passwords**, | 1. **Use long passwords**, | ||
+ | |||
2. **Add a " | 2. **Add a " | ||
For example: | For example: | ||
\[ | \[ | ||
- | \text{md5}(1234 + \text{my\_strong\_salt}) = 0e0db19d64ce23edc1bfb52063f25028 | + | \text{md5}(1234 + \text{salt}) = 0e0db19d64ce23edc1bfb52063f25028 |
\] | \] | ||
tanszek/oktatas/techcomm/hash_functions.1728314802.txt.gz · Last modified: 2024/10/07 15:26 by knehez