# How to put the hash of a PDF file in the PDF file? [duplicate]

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 http://renyi.hu/~csirmaz/nws06/xajanlo.ps -O Md5-xajanlo.ps; wget -q http://renyi.hu/~csirmaz/nws06/xutasit.ps -O Md5-xutasit.ps; md5sum Md5-xajanlo.ps; md5sum Md5-xutasit.ps; sha512sum Md5-xajanlo.ps; sha512sum Md5-xutasit.ps; rm Md5-xajanlo.ps Md5-xutasit.ps
583bdceb34826c38ac7f1fdac3aca807  Md5-xajanlo.ps
583bdceb34826c38ac7f1fdac3aca807  Md5-xutasit.ps
205c18b396bee84995d8c325787600ca88ca3d9758c4dfe89cdaa242ab9513710057c5fce55afb2c6ef3117703be7c31266a1fa6fbac1f369b82f0719587c60c  Md5-xutasit.ps
[user@notebook ~]

-

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

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: crypto.stackexchange.com/questions/9910/… – figlesquidge Nov 22 '13 at 10:35

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