htdigest文件格式 [英] htdigest file format

查看:244
本文介绍了htdigest文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着写一些code与htdigest口令文件的工作。我能找到的文档似乎声称该文件的格式为:

I'm trying to write some code to work with an htdigest password file. The documentation I can find seems to claim that the format of that file is:

user:realm:MD5(user:realm:pass)

如果是这样的话,那么为什么不这项工作给我吗?我创建使用命令行的文件htdigest这样的:

If that is the case, then why doesn't this work for me? I created a file with the command line htdigest thus:

htdigest -c test b a

当输入密码提示我输入C。这将创建内容的文件:

When prompted for a password I entered 'c'. This creates a file with the contents:

a:b:02cc8f08398a4f3113b554e8105ebe4c

但是,如果我试图推导出这个哈希我不能,

However if I try to derive this hash I can't,

echo a:b:c | md5

给我49d6ea7ca1facf323ca1928995420354。有没有办法,我在这里失踪了一些东西明显?

gives me "49d6ea7ca1facf323ca1928995420354". Is there something obvious that I'm missing here?

感谢

推荐答案

回声默认情况下,增加了一个新的尾随行:

echo by default adds a trailing new line:

echo -n a:b:c | md5

如您所愿应该工作。

Should work as you expect.

这篇关于htdigest文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆