官术网_书友最值得收藏!

Slower is sometimes better

In some situations, processes are designed to be slow, and this is essential to their operation and security. A good example of this, which may be a hit in profiling, is password hashing or key stretching. A secure password hashing function should be slow so that the password, which (despite being bad practice) may have been reused on other services, is not easily recovered.

We should not use generic hashing functions, such as MD5, SHA1, and SHA256, to hash passwords because they are too quick. Some better algorithms that are designed for this task are PBKDF2 and bcrypt or even Argon2 for new projects. Always remember to use a unique salt per password too. We won't go into any more details here, but you can clearly see that speeding up password hashing would be bad, and it's important to identify where to apply optimizations.

主站蜘蛛池模板: 漳浦县| 信阳市| 临沭县| 梁平县| 徐汇区| 岳池县| 大庆市| 雷山县| 通河县| 湖南省| 靖远县| 九江市| 五指山市| 彭阳县| 孟连| 城步| 营口市| 兰西县| 漠河县| 龙井市| 延寿县| 修水县| 邳州市| 江华| 大化| 刚察县| 西畴县| 灵山县| 岱山县| 林口县| 鄂伦春自治旗| 龙岩市| 且末县| 濮阳市| 武汉市| 香格里拉县| 福建省| 岳普湖县| 安徽省| 邛崃市| 博野县|