Facet-MUD-Project/facetjs

Password hashers need some hardening

开放

#36 创建于 2020年8月6日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (0 个派生)auto 404
enhancementhelp wantedsecurity

仓库指标

星标
 (1 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is your feature request related to a problem? Please describe. Right now, although we use PBKDF2 with a SHA512 hash, we use a static salt and static iteration count. This makes things not quite as secure as they could/should be. We also can't easily increase the iteration count for future purposes.

Describe the solution you'd like We need something more like what Django does: https://github.com/django/django/blob/136ec9b62bd0b105f281218d7cad54b7db7a4bab/django/contrib/auth/hashers.py#L247-L299

In the decode method you can see:

algorithm, iterations, salt, hash = encoded.split('$', 3)

This indicates that passwords are stored in the format:

pbdkf2_sha512$260000$random_string_for_salt$hashed_password

Currently, we only share the last part of that; the hashed_password.

贡献者指南