本文介绍了如何使用java生成像apache的htpasswd这样的哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在htpasswd中使用强制MD5加密密码来生成哈希,例如'123'我得到:i use "Force MD5 encryption of the password" in htpasswd to generate a hash for instance '123' i get:使用htpasswd:123 => $ apr1 $ kaTbKaLO $ ewJXRZAKpjaxK4thy2jOp / use htpasswd: 123 => $apr1$kaTbKaLO$ewJXRZAKpjaxK4thy2jOp/使用MD5摘要:123 => 202cb962ac59075b964b07152d234b70 use MD5 digest: 123 => 202cb962ac59075b964b07152d234b70请告诉我如何生成像apache htpasswd这样的哈希使用java 谢谢。please tell me how can i generate a hash like the apache htpasswd using javaThanks.推荐答案 Apache .htpasswd文件中的密码使用 salt 。如果要使用Java生成这些密码,则需要执行相同的操作。 此站点解释了用于Apache的salt / hashing算法。 htpasswd文件;我正在寻找一个你可以使用的实际算法,并在我找到之后编辑我的答案。Passwords in Apache .htpasswd files are encoded using a salt. If you want to generate these passwords using Java you'll need to do the same. This site has an explanation of the salt/hashing algorithm used for Apache's .htpasswd files; I am looking for an actual algorithm you could use and will edit my answer after I find one. 编辑:看起来之前有人问过,就在这里SO:EDIT: Looks like it's been asked before, right here on SO: 以编程方式构建htpasswd 以下是Apache的文档及其源代码:Here's the documentation from Apache, along with their source code: http://httpd.apache.org/docs/2.2/misc/password_encryptions.html http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/crypto/apr_md5.c?view=co 这篇关于如何使用java生成像apache的htpasswd这样的哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-20 22:54