htdigest 文件格式 [英] htdigest file format
问题描述
我正在尝试编写一些代码来处理 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
默认添加尾随换行:
echo -n a:b:c | md5
应该会如您所愿.
这篇关于htdigest 文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!