Last active
September 23, 2019 12:47
-
-
Save vraghuvaran/5eb5fc3d8d77eb75aa6ae96f514407c5 to your computer and use it in GitHub Desktop.
This is the simple python algorithm for digest authentication if qop selected is auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################## | |
# realm=value generated by the server when identified by the client browser it displays # | |
# authentication for user # | |
# noncecount=count of the nonce generated by the client # | |
# clientnonce=nonce generated by the client # | |
# qop=denotes the option selected by the client out of list of qop options generated by the # | |
# server # | |
# nonce=random string generated by the server # | |
############################################################################################## | |
import hashlib | |
hash1=hashlib.md5('username:realm:password').hexdigest() | |
hash2=hashlib.md5('method:URI').hexdigest() | |
response=hashlib.md5('hash1:nonce:noncecount:clientnonce:qop:hash2').hexdigest() | |
print(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment