Key Generation:
- Choose two large random prime numbers P and Q of approximately equal size.
- Compute n = P . Q and fi = (p-1) . (Q-1)
- Choose an integer positive integer e, which is less than fi, such that gcd(e,fi)=1
- Compute secret component d, such that d is positive and less than fi, and e.d = 1 (mod fi)
- Declare public key (n,e) and the private key as (n,d)
--------------------------------------------------------------------------------------
Now let A wants to send a message m to B.
Encryption By A:
- Obtain B's public key (n,e)
- When message to be send is m. compute c = (m^e) mod n
- Send c to B.
- B uses his private key (n,d) to compute m = (c^d) mod n
- m is the required message.
What actually digital signature is ?
Let you want to send a message to a recipient, you prepare the message and send it to the recipient, but the problem here is that the recipient on getting the message want to be sure that message is actually written by you. To satisfy this requirement you have to provide some additional information to the recipient that makes him sure about your authorization to the message. This additional information is called digital signature. The final line is that, to send a message X you actually have to send the pair (X, digital signature for X).
For example let A wants to put digital signature on any of his document DOC
Digital Signature:
- Create a message digest of the information to be sent. In our case A uses any of the hash function (let f) to find message digest f(DOC)
- represent this digest as an integer m between 0 and n-1. In our case take modulus i.e. m=f(DOC) mod n.
- Use own private key (n,d) to compute the signature s=(m^d) mod n
- Send this signature s to the recipient. in full send (DOC,s) to receiver
receiver gets (DOC,s) from the sender
- Use the sender's public key (n,e) to compute integer v=(s^e) mod n, this is the process of extraction of the message digest
- Independently compute the message digest of the information that has been signed, that is compute f(DOC)
- if both message digests are identical, the signature is valid.
1 comment:
It good to know the algorithm about the public key cryptography. It is my pleasure that i am able to read it. let me try it. Hopefully, I will also get success.
Post a Comment