## Program in c++, Secure multiparty computation: A research problem in computer science where ‘multiple’ parties participate in a ‘computation,’ by providing an input to the computation.

### computer science

##### Description

Program in c++, Secure multiparty computation: A research problem in computer science where ‘multiple’ parties participate in a ‘computation,’ by providing an input to the computation. The idea is at the end, everyone knows the computation output, but no one knows (hence ‘secure’) what a party’s input is. An example of a computation is to find the sum of everyone’s input.

OK, let us solve. For example, suppose .there are 3 parties (A, B, C), and (their respective) inputs are 23, 12, 45. Compute the sum (= 80), but no one knows (except A) what A’s input is 23. Similarly, no one knows B’s and C’s input. We can solve it by anyone (say, A) adding a random # to its contribution and passing to the next party. So, if the random # is 123, A passes to B 146 (but B won’t know what portion of 146 is A’s original input); B adds to what is received, its contribution and passes to C (158); C adds its contribution and passes back to A (203). Now A just takes off the original random # from it to get the sum 80,

The attached .cpp file needs to be edited so that the follow requirements are changed:

1. Program has parent and two children for a family of three processes (for example, parent is A, the two children B and C), and 3 pipes AtoB, BtoC, CtoA Use the pipes to implement secure multiparty computation.

1. Use cin to get the three inputs (no prompt required before input). Each process has one cin, and in response to the ONE line user input below, the three process get the input (one each, does not matter who gets which one)

23 12 45

1. Each of the three processes prints ONE line:

{P or C} myProcessID, myParentID, input, recivedFromPipe, transmittedToPipe

For example, one of the children’s cout is: C 1234 5678 158 203 (means: Child with process id 1234; parent id 5678, user input 45; received from pipe 158, passed to pipe 203).

1. In addition, parent prints a line with the result of the computation, for example: P 80

1. How is the program run? a.out randomNumberSeeed [Note: 1st process initializes the random number generator before drawing the random #, for example: srand (atoi (argv[1]); int myRandomNo = rand (); //atoi converts from ascii to integers]