What is Signing / Digital Signatures

This is NOT Hash encrypted by PVT-KEY.
it is a another hash value which is generated using SIGNING FUNCTION


h = hash (sha256(message))
d = Private key
e = public key
n = public exponent

Signature(S) = (h pow(d))mod n  //Sender sends S

h = (S pow(e))mod n   //Reciever calculate hash
      


Sender
message > [sha256] -> hash(h1)
                        \/
              [SigningFunction(RSA)] > Digital-Signature
                        /\
                      Pvt-key

          Sender ---------- h1, Digital-Signature ------> Reciever

                                                DS --> [VerifyFunction] --> h2
                                                            /\
                                                            publickey

                                                        if (h1 == h2)
                                                          Integrity verified

// Sender
SigningFunction(messageToBeSigned, PvtKey, PublicExponent) {
  return digitalSignature=Hash
}

// Receiver
VerifyFunction (RecieveddigitalSignature, PublicKey, PublicExponent) {
  return Hash
}
    

Algorithms for Generating DS

1. DSA(DIGITAL SIGNATURE ALGO)

Based on the algebraic properties of the modular exponentiations, together with the discrete logarithm problem

2. RSA

trie

2. ECDSA(ECLIPTIC CURVE DSA)

Variant of DSA which uses ECC. Suppose Alice wants to sends signed message to Bob.


Step-1: Both agree on Curve parameters.(CURVE,G,n)
  CURVE: equation to be used. ECC(y2 = x3 + ax +b) Alice and bob chooses curve(y2 = x3 + 7)
  G(Base point): (x0,y0) on chosen curve (y2 = x3 + 7)
  n(Prime No): Multiplier of G. n X G = O. O is identity element.

Step-2-n: Alice Signs message and sends Signature (r,s) //Since ECDSA sends pair as public key