我使用了消息摘要,我看到它有时与salt
synchronized (hasher) {
hasher.update(salt); // "Updates" the digest using the specified byte.
salt++;
digest = hasher.digest(data); // Final "updates" on the digest using the specified array of bytes, then "completes" the digest computation.
}
有时不加盐:
md.update(data);
byte[] toChapter1Digest = md.digest();
现在,我什么时候可以使用摘要salt
和不应该?我得出的简短研究结论是,只要涉及密码元素,就会使用盐。