Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Latest commit

 

History

History
94 lines (64 loc) · 4.93 KB

File metadata and controls

94 lines (64 loc) · 4.93 KB

Elliptic Curve Digital Signature Authentication

Prerequisites:

  1. Elliptic Curves
    • Point Addition, Scalar Multiplication
  2. Cyclic Groups on Elliptic Curves

In this section, we will discuss the following topics:

  1. Signature Generation using Elliptic Curves
  2. Signature Verification using Elliptic Curves
  3. Correctness of the signature algorithm

Consider Alice as the person who is generating a signature of a message M and Bob as a signature verifier.

Let us define the notations that will be used throughout this writeup:

  1. G - a point on the Elliptic Curve, chosen as the base point
  2. xQ, yQ - x, y coordinates of a point Q on the Elliptic Curve
  3. n - order of the subgroup generated by G
  4. N - order of the Elliptic Curve
  5. p - size of the finite field over which the Elliptic Curve is defined
  6. e - HASH(m), where HASH() is a cryptographically secure hash function. A hashing algorithm is selected by signature generator and verifier when the communication between the two is just established.
  7. z - Ln left most bits of e, where Ln is the bit length of n
  8. M - message that is to be signed
  9. dA - Alice's private key

Let PA be Alice's public key which is calculated as picture, where dA is Alice's private key.

Signature Generation

In this section, we will discuss how signatures are generated using Elliptic Curves.

Like most of the Digital Signature Authentication algorithms, ECDSA (Elliptic Curve Digital Signature Authentication) too signs the hash of the message rather than the message itself. This makes it convenient to sign even large sized files/documents.

To sign a message:

  1. Calculate hash of the message that you want to sign ie. e = HASH(M). Note that HASH() should be a cryptographically secure hash function.
  2. Calculate z = Ln left most bits of e, where Ln is the bit length of n
  3. Choose a random integer k such that picture
  4. Calculate picture
  5. Calculate picture
    • Check if r=0, if yes then go back to Step-3
  6. Calculate picture
    • Check if s=0, if yes then go to back to Step-3
  7. The pair (r, s) is the signature

Along with the signature pair, there are other values involved in the verification that are public: e, z, Q, G, PA.

Signature Verification

In this section, we will discuss how signatures are verified using Elliptic Curves.

Prior to the verification algorithm, the following conditions must be checked and must hold true:

  1. PA must lie on the curve.
  2. nPA must be equal to 0, note that 0 is the arbitrary point defined on the Elliptic Curve and is considered to be at infinity and along y-axis
    • We are checking this because PA = dAG and nG=0 (Order of the subgroup generated by G multiplied by G is equal to 0). Hence, nPA=k(nG) = k0 = 0

To verify a signature:

  1. Calculate picture
  2. Calculate picture
  3. Calculate picture
  4. The signature is valid only if picture, here xT is the x-coordinate of point T

Correctness of the algorithm

Let us expand Step-3 in the signature verification and then see how the algorithm correctly verifies Alice:
picture
Since, picture, we can write:
picture
= picture
Expanding u1 and u2 we can write the above equation as:
picture
Substituting s we get:
picture
So, picture
And hence, picture

Resources

To study more about Elliptic Curves and ECDSA, you can refer to this amazing blog post on ECDSA by Andrea Corbellini- http://andrea.corbellini.name/2015/05/30/elliptic-curve-cryptography-ecdh-and-ecdsa/

References

  1. ECDSA - Wikipedia
  2. Andrea Corbellini's blog