The Wayback Machine - https://web.archive.org/web/20240606172037/https://www.geeksforgeeks.org/lamport-one-time-signature-scheme/
Open In App

Lamport One Time Signature Scheme

Last Updated : 31 May, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Lamport One Time Signature is a method for constructing a digital signature and typically involved the use of a cryptographic hash function. As it is a one-time signature scheme, it can only be used to securely sign one message. 
Suppose Alice wants to digitally sign her message to Bob, the process can be explained in 3 steps: 

  1. Key Generation
  2. Signature Generation
  3. Signature Verification.


1. Key Generation: 

  • Alice first needs to create a Lamport key pair, a private key and a corresponding public key.
  • In order to create the private key, a secure random number generator is used to generate 256 pairs of random numbers. Each number consists of 256 bits. Alice will store this private key securely. Remember that the private key is not meant to be shared with anyone.
  • In order to create the public key, Alice hashes each of the 512 numbers of her private key. This will produce another 512 numbers, each consisting of 256 bits. This is the public key that will be shared with anyone.


In mathematical representation: 

  • let k  be a positive integer, P={\{0,1\}}^k  be the set of messages to be signed and f:Y\rightarrow Z  be a one way hash function.
  • For 1\lei\le i\lei\le k  and j\in{0,1}  , Alice randomly chooses y_{i,j}\inY  and applies the one way hash function to compute z_{i,j}=f(y_{i,j})  .
  • The private key and public key both consists of 2k  values, y_{i,j}  and z_{i,j}  respectively.



2. Signature Generation: 

  • Alice hashes her message using a 256-bit cryptographic hash function, eg SHA 256, to obtain a 256-bit digest.
  • For each bit, depending on whether the bit value is 1 or 0, Alice will pick the corresponding number from the pair of numbers of her private key i.e. if the bit is 0, the first number is chosen, and if the bit is 1, the second number is chosen. This results in a sequence of 256 numbers which is her signature. 

     
Lamport One Time Signature Scheme
  • Alice sends the message along with her signature to Bob.



In mathematical representation, 

  • let M=m_1,m_2,\ldots,m_k\ \in\left\{0,1\right\}^k  be the message Alice wants to sign.
  • The signature is generated as sig\left(m_1,m_2,\ldots,m_k\right)  =\left({y_1,}_{m1,\ }{y_2,}_{m2,}\ldots,{y_k,}_{mk}\right)  =\left(s_1,s_2,\ldots,s_k\right)  .
  • This signature is sent to Bob along with the message.


3. Signature Verification: 

  • Bob hashes the message using the same 256-bit cryptographic hash function, to obtain a 256-bit digest.
  • For each bit, depending on whether the bit value is 1 or 0, Bob will pick the corresponding number from Alice’s public key i.e if the first bit of the message hash is 0, he picks the first hash in the first pair, and so on. This is done in the same manner as shown in the diagram above. This results in a sequence of 256 numbers.
  • Bob hashes each of the numbers in Alice’s signature to obtain a 256-bit digest. If this matches the sequence of 256 numbers that Bob had previously picked out, the signature is valid.


In mathematical representation, Bob checks that f(s_i)={z_I,}_{mi\ }  for all 1\lei\le i\lei\le k


Note:It is important to understand that since Alice has publicly published half of a private key as her signature, her remaining private key cannot be used again and must be destroyed.
 


Similar Reads

Winternitz One Time Signature Scheme
Winternitz One Time Signature (WOTS) is a quantum resistant digital signature scheme that uses relatively small key and signature sizes. As it is a one-time signature scheme, it can only be used to securely sign one message. Suppose Alice wants to digitally sign her message to Bob, the process can be explained in 3 steps: Key Generation, Signature
2 min read
What is a Signature Block? How to Create Signature Block
A Signature block is a personalized section of text that automatically appears at the bottom of emails, articles, documents, or contracts. It typically includes the sender's or author's details such as their name, position, and contact information. The primary purpose of a signature block is to help recipients identify the sender or author, making
6 min read
Difference between Direct and Arbitrated Digital Signature
Prerequisite - Digital Signatures The Direct Digital Signature is only included two parties one to send a message and the other one to receive it. According to the direct digital signature both parties trust each other and know their public key. The message is prone to get corrupted and the sender can decline the message sent by him at any time. Ad
5 min read
Types of Digital Signature Attacks
Digital Signature is a mathematical technique that verifies the authenticity of the message or document and also provides non-repudiation where the sender cannot deny signing the document. As the digital signature provides authenticity and non-repudiation in order to secure important data, it is very much susceptible to various attacks. Types of Di
2 min read
Schnorr Digital Signature
In cryptography, a Schnorr signature is a digital signature produced by the Schnorr signature algorithm that was described by Claus Schnorr. It is a digital signature scheme known for its simplicity, is efficient and generates short signatures. It is one of the protocols used to implement "Proof Of Knowledge".In cryptography, a proof of knowledge i
4 min read
Digital Signature Standard (DSS)
As we have studied, signature is a way of authenticating the data coming from a trusted individual. Similarly, digital signature is a way of authenticating a digital data coming from a trusted source. Digital Signature Standard (DSS) is a Federal Information Processing Standard(FIPS) which defines algorithms that are used to generate digital signat
3 min read
Difference Between Digest and Digital Signature
A Digest acts like a fingerprint for data that verifies if it is altered, and a Digital Signature is similar to a secret code, confirming the sender's identity and data integrity. Knowing the contrast between a digest and a digital signature is important for protecting digital information. In this article, we will understand the difference between
5 min read
Digital Signature Algorithm (DSA)
A Digital Signature is a verification method made by the recipient to ensure the message was sent from the authenticated identity. When a customer signs a check, the bank must verify that he issued that specific check. In this case, a signature on a document acts as a sign of authentication and verifies that the document is authentic. Suppose we ha
14 min read
Time difference between expected time and given time
Given the initial clock time h1:m1 and the present clock time h2:m2, denoting hour and minutes in 24-hours clock format. The present clock time h2:m2 may or may not be correct. Also given a variable K which denotes the number of hours passed. The task is to calculate the delay in seconds i.e. time difference between expected time and given time. Ex
5 min read
Schnorr Identification Scheme
Schnorr signature is known for its simplicity and is among the first whose security is based on the intractability of certain discrete logarithm problems. The Schnorr digital signature scheme is different from the identification scheme. An identification scheme is used for the holder of the private key to prove to you that they hold the private key
4 min read
Practice Tags :