Implementing ElGamal Elliptic Curve Cryptography

Steps of implementing ElGamal ECC:

  1. Generating elliptic curve and choosing random base point ( B )
  2. Generating private and public key for the receiver ( A computes P_A=k_AB and send it to B. B computes P_B=k_BB )
  3. Generating message and a random point ( message point = P_m , A then choose a random bit pattern r )
  4. Embed the message onto the curve and send the result with the random point ( A computes two points: P_r=rB and P_h=P_m+rP_B then send the two points to B)
  5. Decrypt the ciphertext and make sure the data sent and received are the same ( B computes P_s=k_BP_r and substracts this from P_h to get P_m=P_h-P_s )