sip 协议中 realm 认证中 Response 值的计算方法:
from hashlib import md5
username = ‘10000′
realm = ‘Yate’
password = ‘10000′
nonce = ‘39a45e7afdc6ec69d156ed1de42cfc5b’
method = ‘REGISTER’
uri = ’sip:127.0.0.1′
print md5(‘%(hash1)s:%(nonce)s:%(hash2)s’ % {‘hash1′:md5(‘%(username)s:%(realm)s:%(password)s’ % {‘username’:username, ‘realm’:realm, ‘password’:password}).hexdigest(), ‘nonce’:nonce, ‘hash2′: md5(‘%(method)s:%(uri)s’ % {‘method’:method, ‘uri’:uri}).hexdigest()}).hexdigest()

本文详细介绍了SIP协议中 Realm 认证过程中Response值的计算方法,包括MD5算法的应用,具体步骤为:计算username:realm:password的MD5值(HASH1),然后计算method:uri的MD5值(HASH2),最后将HA1(HASH1)、nonce和HA2(HASH2)进行MD5运算得到最终的Response值。
最低0.47元/天 解锁文章
1171

被折叠的 条评论
为什么被折叠?



