Digital signatures are cryptographic mechanisms used to verify the authenticity and integrity of numbers and data. We can think of it as a digital version of the traditional handwritten signature method, and is more complex and secure than signatures.
In short, we can understand a digital signature as a code attached to a message or document. Once a digital signature is generated, it serves as proof that the message has not been tampered with during its journey from sender to receiver.
While the concept of using cryptography to protect the confidentiality of communications dates back to ancient times, digital signature schemes only became a reality in the 1970s with the development of public key cryptography (PKC). So, to understand how digital signatures work, we first need to understand the basics of hash functions and public key cryptography.
hash function
Hashing is one of the core elements in digital signatures. The operation process of hash value refers to converting data of any length into a fixed length. This is achieved through a special operation called a hash function. The value generated by the hash function is called a hash value or message digest.
When a hash value is combined with a cryptographic algorithm, which uses a cryptographic hash function to generate a hash value (digest), the value acts as a unique digital fingerprint. This means that any change to the input data (message) will result in a completely different output value (hash value). This is why cryptographic hash functions are widely used to verify the authenticity of numbers and data.
Public key cryptography (PKC)
Public key cryptography, or PKC, refers to an encryption system that uses a pair of keys: a public key and a private key. The two keys are mathematically related and can be used for data encryption and digital signatures.
As an encryption tool, PKC has higher security than symmetric encryption. Symmetric encryption systems rely on the same key to encrypt and decrypt information, but PKC uses a public key for data encryption and a corresponding private key for data decryption.
In addition to this, PKC can also be applied to generate digital signatures. Essentially, the process involves the sender encrypting the hash of the message (data) using its own private key. Next, the recipient of the message can check whether the digital signature is valid using the public key provided by the signer.
In some cases, the digital signature itself may include encryption, but not always. For example, the Bitcoin blockchain uses PKC and digital signatures, and unlike most people believe, there is no encryption in the process. Technically speaking, Bitcoin in turn deploys the so-called Elliptic Curve Digital Signature Algorithm (ECDSA) to verify transactions.
How digital signatures work
In the context of cryptocurrency, a digital signature system typically consists of three basic processes: hashing, signing, and verification.
Hash the data
The first step is to hash the message or data. This is done by operating on the data using a hashing algorithm to generate a hash value (i.e. message digest). As mentioned above, messages can vary greatly in length, but when messages are hashed, their hash values are all the same length. This is the most basic property of hash functions.
However, merely hashing the message is not necessary to generate a digital signature, since messages that have not been hashed can also be encrypted using the private key. But for cryptocurrency, messages need to be processed by a hash function, because processing fixed-length hash values helps cryptocurrency programs run.
sign
After the information has been hashed, the sender of the message needs to sign their message. Public key cryptography is used here. There are several types of digital signature algorithms, each with its own unique operating mechanism. Essentially, a hashed message (hash value) is signed using a private key, and the recipient of the message can then check its validity using the corresponding public key (provided by the signer).
In other words, if the private key is not used when generating a signature, the recipient of the message will not be able to use the corresponding public key to verify its validity. Both public and private keys are generated by the sender of the message, but only the public key is shared with the recipient.
It is important to note that digital signatures are associated with the content of each message. Therefore, unlike handwritten signatures, digital signatures are different for each message.
verify
Let’s take an example to illustrate the entire process, from the beginning to the final step of verification. Let's assume that Alice sends a message to Bob, hashes the message to a hash value, and then combines the hash value with her private key to generate a digital signature. The digital signature will serve as the unique digital fingerprint of the message.
When Bob receives the message, he can check the validity of the digital signature using the public key provided by Alice. This way, Bob can be sure that the signature was created by Alice, since only she has the private key corresponding to the public key (at least that's what we assumed).
Therefore, it is important for Alice to keep her private key safe. If another person gets Alice's private key, they can also create a digital signature and pretend to be Alice. In the context of Bitcoin, this means that someone has access to Alice's private keys and can transfer or use her Bitcoins without her knowledge.
Why are digital signatures important?
Digital signatures are typically used to achieve three goals: data integrity, authentication, and non-repudiation.
Data integrity. Bob can verify whether Alice's message has been tampered with. Any changes in the message will produce a completely different digital signature.
Authenticity. As long as Alice keeps her private key safe, Bob can use her public key to confirm that the digital signature was created by Alice herself and not by someone else.
Non-repudiation. After generating a signature, Alice cannot deny signing that signature in the future unless her private key is somehow compromised.
Case
Digital signatures can be applied to a variety of digital documents and certificates. Therefore, they have several applications. Some of the most common cases include:
information Technology. Enhance the security of Internet communication systems.
finance. Digital signatures can be applied to audits, financial reports, loan agreements, and more.
law. Digital signatures can be applied to a variety of business contracts and legal agreements, including government documents.
health care. Digital signatures prevent fraud in prescriptions and medical records.
Blockchain. Digital signature schemes ensure that only the legitimate owner of a cryptocurrency can sign transactions and move funds (as long as their private keys are not compromised).
limitation
The main challenges faced by digital signature schemes are mainly limited to the following three factors:
algorithm. The algorithms used in digital signature schemes have high quality requirements. These include the choice of reliable hash functions and encryption systems.
Implementation. If the algorithm is complete, but there is no good implementation plan, the digital signature system may also have hidden dangers.
private key. If the private key is lost or compromised in some way, authenticity and non-repudiation are not guaranteed. For cryptocurrency users, losing private keys can result in significant financial losses.
Electronic signatures and digital signatures
In short, a digital signature can be understood as a specific type of electronic signature, which refers to the use of electronic means to sign documents and messages. Therefore, all digital signatures can be considered electronic signatures, but not vice versa.
The main difference between them is the authentication method. Digital signatures require the deployment of cryptographic systems such as hash functions, public key cryptography, and encryption techniques.
Summarize
Hash functions and public key cryptography are at the heart of digital signature systems and are now used in a variety of cases. When implemented properly, digital signatures can improve security, ensure integrity, and facilitate authentication of all types of data.
In the blockchain world, digital signatures are used to sign and authorize cryptocurrency transactions. They are especially important for Bitcoin because digital signatures ensure that a token can only be used by someone with the corresponding private key.
While we've been using electronic and digital signatures for years, there's still a lot of room for growth. Today, most official documents are still based on paper materials, but as more systems migrate to digital, we will see more digital signature solutions.

