android sha512 example

只愿长相守 提交于 2019-11-30 05:32:31
Chris Jester-Young

Read my post here, especially the post I linked to about password hashing.

  • You should ideally use bcrypt or scrypt rather than doing your own password hashing.
  • But if you must, you should run for a few thousand iterations at the minimum, preferably more.

Yes, you can use MessageDigest for SHA-512. Each time you call digest, the state of the object automatically resets, which is really handy---you can start updating for the next iteration straight away.

But I still think you should use bcrypt or scrypt instead. For your own good, and the good of your users. :-)

a HMAC is found to be sufficient for what you wanna do and it does only 2 iterations

it boils down to

hash = sha512(concat(xor(salt,nonce2),sha512(concat(xor(salt,nonce1),pw)));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!