SHA2 password hashing in java

后端 未结 4 1082
盖世英雄少女心
盖世英雄少女心 2020-12-08 17:05

I\'m trying to hash some passwords with SHA2.

Where can I get a snippet of java code for make that?

I have seen that post but I have something missing: SHA2

4条回答
  •  余生分开走
    2020-12-08 18:00

    Phrase would be the password that you're trying to protect. key is the salt, a unique (and known) string appended to your password before hashing, to defeat rainbow tables. Or it should be, at least. Your code is just taking it from the password itself, which is kind of pointless. It should be a long random string that is stored together with the password digest.

提交回复
热议问题