The document is reduced to a digital fingerprint
Before signing, software runs the document’s contents through a hash function: a mathematical process that turns the data into a short, fixed-length string called a hash. A tiny change—such as replacing a comma with a period—produces a very different hash. The hash is not a compressed copy of the document; it is a fingerprint used to check whether the contents still match.
The signer locks that fingerprint with a key
The signing software uses the signer’s private key to create a digital signature based on the hash. The private key is secret; a corresponding public key can be shared so others can check the signature. This links the signature to the particular contents that were signed, rather than merely to the filename or the document’s appearance.
Verification checks both the signature and the contents
To verify a file, software calculates its hash again and uses the public key to check the signature. If the document is unchanged, the checks agree. If even one comma has changed, the newly calculated hash differs, so verification fails.
That failure signals that the file no longer matches what was signed. It does not identify which character changed or prove why it changed; nor does the signature encrypt the document. Its practical value is a reliable warning that the contents being read are not the same contents the signer approved.






