Decryption for distributed Boneh-Franklin IBC

March 17, 2013 | Posted in Asynchronous Key Generation for IBE

This is the corresponding decryption function for a message C = (u, v, w)

void decrypt20(unsigned char * u, unsigned char * v, unsigned char * w){
  int i;
  unsigned char sig[20], tsig[20], hsig[20], m[20];
  element_t U, temp1, g, gpub;
  element_from_bytes(U, u);

  element_init_GT(temp1, pairing);
  pairing_apply(temp1, U, pk, pairing); //temp1 = e(U, pk) ~ e(u, did)
  hash2(tsig);                          //tsig = H2(e(u, did))
  for(i=0;i<20;i++){
    sig[i] = v[i] ^ tsig[i];            //sig = v XOR H2(e(u, did))
  }
  hash4(sig, hsig);                     //hsig = H4(sig)
  for(i=0;i<20;i++){
    m[i] = w[i] ^ hsig[i];              //m = w XOR H4(sig)
  }
  hash3(sig, m);                        //r = H3(sig, m), r = h3zr
  element_init_G1(g, pairing);
  element_init_G1(gpub, pairing);
  element_random(g);

  element_pow_zn(gpub, g, h3zr);        //gpub = g ^ h3zr <==> g^r

  if (!element_cmp(gpub, U))            //if g^r != u, reject
    printf("Message is %s\n", m);
  else
    printf("Invalid message.\n");
}

Related Posts

29 Jul 2013 » Overlapping collisions

16 Mar 2013 » Encryption for distributed Boneh-Franklin IBC

15 Mar 2013 » Hash functions for distributed Boneh Franklin IBC

05 Mar 2013 » Importing and exporting an element in PBC

02 Mar 2013 » Using python to complete IBC

27 Feb 2013 » Modifying a DKG header

23 Feb 2013 » Understanding DKG

20 Feb 2013 » Pseudo code for the mathematical functions

20 Feb 2013 » Distributed Key Generation in BFIBC

19 Feb 2013 » Algorithm to Generate IBC Keyshares

19 Feb 2013 » Modifying the DKG protocol

19 Feb 2013 » Asynchronous Distributed Key Generation for Identity-Based Cryptography

19 Feb 2013 » Boneh Franklin IBC using the PBC library