Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know it sounds strange.. but, are there any ways in practice to put the hash of a PDF file in the PDF file? And after geting the hash in the PDF file - if someone would do a hash check of the PDF file, the hash would be the same as the one that is already in the PDF file? :) maybe with MD5, since it's known to have weaknesses? Example:

[user@notebook ~] wget -q -O; wget -q -O; md5sum; md5sum; sha512sum; sha512sum; rm
[user@notebook ~] 
share|improve this question

marked as duplicate by D.W., Gilles, e-sushi, archie, rath Nov 25 '13 at 7:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

And what happens if i simply modify the pdf and replace the hash that you have put into the pdf file accordingly? ;) I guess signing the pdf file is what you are looking for. – DrLecter Nov 22 '13 at 7:43
it seems that you are asking a way to solve this equation $H(**a***)=a$ – T.B Nov 22 '13 at 7:56
Could you explain your motivation if you would like to do what Alex assumes? – DrLecter Nov 22 '13 at 8:02
@DrLecter: good point :) – newuser999 Nov 22 '13 at 8:08
See this question:… – figlesquidge Nov 22 '13 at 10:35
up vote 3 down vote accepted

You cannot push the hash of a file 'in' the file, as newly modified file will have a different new hash....

As said, it seems that you are asking a way to solve this equation H(∗∗a∗∗∗)=a

share|improve this answer
Kudos for giving an answer to the question as worded, and sorry that I initially missed that. – fgrieu Nov 22 '13 at 21:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.