I have asked a similar question here How do I calculate the MD5 checksum of a file contents in Python?
My solution is, I have extracted all text from the pdf file and calculate the md5 checksum on that content which gives me result what I want but PyPdf2 is not good with the password-protected pdf.
Please let us know if you have any other solution for the above issue.