Last active
December 6, 2019 01:04
-
-
Save vraghuvaran/d13751443d76377a84be104e5250d6ca to your computer and use it in GitHub Desktop.
This is the simple python algorithm for digest authentication mentioned in RFC 2617 if qop field option selected is auth-int
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:md5(entitybody)').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