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

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.

主站蜘蛛池模板: 巴里| 石楼县| 南江县| 墨江| 博罗县| 蛟河市| 海南省| 张掖市| 霍邱县| 阳东县| 皋兰县| 丹凤县| 崇信县| 应用必备| 湖州市| 德化县| 阳江市| 高青县| 通辽市| 姚安县| 三台县| 平陆县| 通化县| 甘洛县| 沭阳县| 西乡县| 汉源县| 邛崃市| 夏邑县| 休宁县| 潞城市| 富蕴县| 申扎县| 宁国市| 通州区| 德格县| 安阳县| 奇台县| 沅江市| 资溪县| 大厂|