Password hashing compatible with Java and PHP

两盒软妹~` 提交于 2019-12-30 06:50:24

问题


Is there a secure password hashing library (e.g. phpass) or hashing method that I can easily use in both PHP and Java?


回答1:


If you want do the easy thing, you can use sha-N with salt. (N being 1, 256 or 512)


Jeff Atwood did a nice blog post on that recently, saying that bcrypt and PBKDF2 are the best options.

In PHP you can use bcrypt (and in Java too)


Related topics:

  • How do you use bcrypt for hashing passwords in PHP?

Resouces:

  • Coding Horror - Speed Hashing
  • Security Stack exchange - Do any security experts recommend bcrypt for password storage?



回答2:


Any standard library such as SHA*, MD* will do. SHA>2 is recommended (e.g. SHA512).




回答3:


md5 and SHA with salt are the most widely used ones.



来源:https://stackoverflow.com/questions/10079700/password-hashing-compatible-with-java-and-php

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