A digital signature is a very large number that is computed from a digital document to verify both its authenticity and authorship.
The document being signed is first hashed, which generates a large number. That number is then encrypted, using the private key of its author. The resulting encrypted number accompanies the original document as its digital signature.
If the digital signature can be successfully decrypted using the author’s public key, that verifies authorship, because only the author could have encrypted it using his private/secret key.
The hash value of the message is recalculated, and if it matches the value resulting from the successful decryption, that verifies the document hasn’t been changed since being signed – any modification, however small, would cause the recalculated hash value to be different than the original one calculated before the message was signed.
Conversely, if the signature cannot be successfully decrypted using the author’s public key, authorship cannot be verified; if the decrypted signature’s value does not match the hash calculated from the document, then the authenticity of the document cannot be verified.