Created
September 21, 2019 17:45
-
-
Save vraghuvaran/13caecb0ef668730f9c05450ec68e044 to your computer and use it in GitHub Desktop.
This is the simple python algorithm to calculate the response field in the response generated by the client in Digest Authentication
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 contains the value which indicates the browser to # | |
# display for authentication and nonce is the long 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:hash2).hexdigest() | |
print(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment