Pingchas 发表于 2024-3-27 12:51:30

关于XMPP之SASL认证Digest-Md5研究

https://wiki.xmpp.org/web/SASL_and_DIGEST-MD5


1. Create a string of the form "username:realm:password". Call this string X.
2. Compute the 16 octet MD5 hash of X. Call the result Y.
3. Create a string of the form "Y:nonce:cnonce:authzid". Call this string A1.
4. Create a string of the form "AUTHENTICATE:digest-uri". Call this string A2.
5. Compute the 32 hex digit MD5 hash of A1. Call the result HA1.
6. Compute the 32 hex digit MD5 hash of A2. Call the result HA2.
7. Create a string of the form "HA1:nonce:nc:cnonce:qop:HA2". Call this string KD.
8. Compute the 32 hex digit MD5 hash of KD. Call the result Z.

X=admin:ihongker.com:123456
Y=md5消息摘要16位MD5(X)

A1=Y:服务端告诉客户端的随机值:客户端生成的随机值:admin
A2=AUTHENTICATE:xmpp/ihongker.com
HA1=md5消息摘要32位(A1)
HA2=md5消息摘要32位(A2)
KD=HA1:nonce:00000001:客户端随机值:auth:HA2
Z=md5消息摘要32位(KD)

此时的Z为response的值

H.U.C清风 发表于 2024-3-30 09:53:49

谢谢分享,已回复。
页: [1]
查看完整版本: 关于XMPP之SASL认证Digest-Md5研究