我不明白我应该如何用 scrypt 存储散列密码。
这是示例:
import pyscrypt
hashed = pyscrypt.hash(password = b"password",
salt = b"seasalt",
N = 1024,
r = 1,
p = 1,
dkLen = 16)
print(hashed.hex()) #70ac953b777e24c4f41c4657eb9f03c2
hashed = pyscrypt.hash(password = b"password",
salt = b"seasalt",
N = 1024,
r = 2,
p = 1,
dkLen = 16)
print(hashed.hex()) #b00b951cd50675806c55d903dba9cbca
hashed = pyscrypt.hash(password = b"password",
salt = b"seasalt",
N = 1024,
r = 1,
p = 2,
dkLen = 16)
print(hashed.hex()) #7c3fa22552c8a9071da0e8c80a0a2767
在上面的示例中,我们可以看到哈希值根据参数N, r, p
值而变化。
这是否意味着我也应该N, r, p
在数据库中保存值?
将来当市场上出现更强大的硬件时,我应该怎么做?例如,要求用户更改密码以便可以应用新的哈希函数或其他什么?