A hash of a document encrypted with a private key . When the digital signature is attached to the document, then anyone with the public key can create their own hash of that document, decrypt the original hash using the public key, and compare. If the hashes match, then it can be concluded that the document sender is confirmed and the document has not been altered. Otherwise the decrypted hash would not match the generated hash.
Malone, J.A (2015). Glossary of Bitcoin Terms and Definitions. United States: Lulu Press, Inc
A digital signature is supposed to be the digital analog to a handwritten signature on paper. We desire two properties from digital signatures that correspond well to the handwritten signature analogy. First, only you can make your signature, but anyone who sees it can verify that it's valid. Second we want the signature to be tied to a particular document, so that the signature cannot be used to indicate your agreement or endorsement of a different document.
A digital signature scheme consists of the following three algorithms.
- (sk, pk) : =generateKeys(keysize) The generateKeys method takes a key size and generates a key pair, The secret key sk is kept privately and used to sign messages. pk is the public key that you give to everybody. Anyone with this key can verify your signature.
- sig : = sign(sk, message) The sign method takes a message and secret key, sk, as input and outputs a signature for message under sk.
- isValid : = verify (pk, message, sig) The verify method takes a message, a signature, and a public key as input. It returns a boolean value, isValid, that will be true if sig is a valid signature for message under public key pk, and false otherwise.
We require that the following two properties hold:
Valid signatures must verify:
verify(pk, message, sign(sk, message)) = = true.
Signatures are existentially unforgeable.
We note that generateKeys and sign can be randomized algorithms. Indeed, generateKeys had better be randomized, because it ought to be generating different keys for different people. In contrast, verify will always be deterministic.
Narayanan, Arvind, et al. (2017). Bitcoin and Cryptocurrency Technologies. United States: Princeton Press