php - How to make a pdf document unique? -


i developping web app generates questions of trial. security important in project. when draw of question trial done app creates pdf document of it. , write encrypted string @ footer of document :

public function footer()  {      if ($this->logo != null) {          $this->image($this->logo, 20, 278, 10, 10, 'png', '', 'c', false, 200, '', false, false, 0, false, false, false);      }       $this->sety(-20);       $this->setfont('helvetica', 'i', 8);       $this->cell(0, 20, 'page '.$this->getaliasnumpage().'/'.$this->getaliasnbpages(), 0, false, 'c', 0, '', 0, false, 't', 'm');      $this->cell(0, 20, date("d/m/y"), 0, 0, 'r', 0, '', 0, false, 't', 'm');      if ( $this->text_crypter != null ) { // encrypted string           $this->sety(-7);          $this->setfont('helvetica', '', 6);         $this->multicell(0, 7, $this->text_crypter, false, 'l', false, 0, '', '', true);      }  } 

as can see encrypted string written @ footer of each page.

enter image description here

but not enough uniquely identify document built app because there may malicious persons may copy encrypted string , paste document.

so means make pdf document proven comes app ?

(collected comments question...)

to uniquely identify document built app, should make application sign document digital signature using private key available app.

Álvaro gonzález pointed towards example 052 : digital signature certification example on how apply digital signature using tcpdf.

ryan vincent explained signature contains hash of pdf document other details. when checked - documents hash checked well. not possible transfer signature different document. check fail.

you can check integrated pdf signature in adobe reader. verify indeed certificate signer certificate in signature verification dialog.

ryan vincent pointed digital signature , cryptography digital signatures tutorial information on how digital signatures work in general.

for details on integrated pdf signatures in particular have @ this answer on information security stack exchange , documents referenced there.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -