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

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.

主站蜘蛛池模板: 壤塘县| 迁安市| 鄢陵县| 海门市| 鹤山市| 甘肃省| 靖远县| 沧源| 融水| 常山县| 扬州市| 陈巴尔虎旗| 噶尔县| 阳山县| 南宁市| 呼玛县| 临沭县| 顺昌县| 红桥区| 永宁县| 大埔县| 淮滨县| 孝昌县| 开阳县| 沁阳市| 台湾省| 望城县| 广宗县| 西平县| 西平县| 晴隆县| 郯城县| 红河县| 达尔| 吉安市| 全南县| 东阿县| 都匀市| 开封市| 安仁县| 泌阳县|