use*_*963 3 cryptography openssl
我正在寻找一种简单的方法(可能使用 openssl)来生成密码的 SCRAM-SHA-1 哈希值,以供 Prosody Jabber Server 使用。服务器上的密码以以下形式存储:
["iteration_count"] = 4096;
["stored_key"] = "f76e63cb5bb7f78e99b07196646c39a0f9422ef7";
["salt"] = "5317fe92-be09-4e0c-8501-55e5fb325543";
["server_key"] = "eb701c012450813185104934f88a9d07a7f211d9";
Run Code Online (Sandbox Code Playgroud)
有人可以提出建议吗?
如果我错了,请纠正我,密码学不是我的强大套件 8-) 但这个库看起来可以给你你想要的。它在 Python 中:
http://pythonhosted.org/passlib/lib/passlib.hash.scram.html
你可以像这样使用它:
>>> hash = scram.encrypt("password", rounds=1000, algs="sha-1,sha-256,md5")
>>> hash
'$scram$1000$RsgZo7T2/l8rBUBI$md5=iKsH555d3ctn795Za4S7bQ,sha-1=dRcE2AUjALLF
tX5DstdLCXZ9Afw,sha-256=WYE/LF7OntriUUdFXIrYE19OY2yL0N5qsQmdPNFn7JE'
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1906 次 |
最近记录: |