Cryptography

How is Digital Signature used with a Document?

A digital signature scheme is primarily a mechanism of making sure the digital documents (such as email, contract documents etc) are not forged in between (integrity) when exchanged between two entities. In addition, it solves the problem of non-repudiation (when a person disagrees that he/she did not sign the document).

A digital signature is nothing but a sequence of numbers which get generated with a document and later used to verify whether the document is signed with the appropriate private key.

Creating a document with a digital signature comprises of the following:

  • Creation of private-public key pair using key generation algorithm. The public key, as per the name, could be shared with the world. The private key remains private to the user.
  • A document signing function which generates the digital signature. The function takes the document and private key as input parameters and generates signature as output.
  • A signature verifying function which ensures that document is signed with an appropriate private key by passing the input parameters as document, signature and public key.

How is Digital Signature created?

The following are the steps for creating a digital signature of a document:

  • A key-generation algorithm is used to create a private-public key pair.
  • The document along with the private key is passed to a mathematical function (signing algorithm). The mathematical function generates a sequence of numbers/characters which represents the digital signature of the document.
  • Alternatively, instead of using the plain document with a private key, the digest of the document along with private key is used to generate the digital signature. The document is passed through a cryptographic hash function which generates the fixed-length digest.

The following diagram depicts the above-mentioned process:

Figure 1. how is digital signature generated

How does the Document with Digital Signature is verified?

The following are the steps for signing the document with digital signature:

  • The document along with digital signature is sent to the other person. In the diagram below, Alice creates a digital signature of the document and sends the document along with the digital signature to Bob. She also shares her public key to the Bob.
  • The other person, Bob in the diagram given below, passes the following to another mathematical function (signature verification algorithm) which returns the response related to whether the document is signed with the same public-private key pair.
    • Document
    • Digital signature
    • Public key

Figure 2. How is digital signature used

References

Summary

In this post, you learned about digital signature scheme including how digital signature is created and used.

Did you find this article useful? Do you have any questions or suggestions about this article? Leave a comment and ask your questions and I shall do my best to address your queries.

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Share
Published by
Ajitesh Kumar

Recent Posts

Retrieval Augmented Generation (RAG) & LLM: Examples

Last updated: 25th Jan, 2025 Have you ever wondered how to seamlessly integrate the vast…

4 days ago

How to Setup MEAN App with LangChain.js

Hey there! As I venture into building agentic MEAN apps with LangChain.js, I wanted to…

1 week ago

Build AI Chatbots for SAAS Using LLMs, RAG, Multi-Agent Frameworks

Software-as-a-Service (SaaS) providers have long relied on traditional chatbot solutions like AWS Lex and Google…

2 weeks ago

Creating a RAG Application Using LangGraph: Example Code

Retrieval-Augmented Generation (RAG) is an innovative generative AI method that combines retrieval-based search with large…

3 weeks ago

Building a RAG Application with LangChain: Example Code

The combination of Retrieval-Augmented Generation (RAG) and powerful language models enables the development of sophisticated…

3 weeks ago

Building an OpenAI Chatbot with LangChain

Have you ever wondered how to use OpenAI APIs to create custom chatbots? With advancements…

3 weeks ago