I am trying to implement a distributed encryption system by having as a main source of information this book (Introduction to Cryptography by Delfs and Knebl) and this Internet article (More Mix than Net by Wood).
I generate the following variables:
- $p$: prime,
- $g$: generator,
- $x$: random within $[1, p-1]$,
- $h$: $g^x \bmod p$
I can then use these variables to successfully encrypt, re-encrypt, and decrypt a message.
I am now trying to make the system use multiple authorities by following subsection 4.5.5 on Delfs's book that states:
According to this subsection $x$ is computed as a random number between $1$ and $q-1$, yet I am using the range $1$ and $p-1$ as shown in the article. Another difference is that in the book there is no mention of modulo $p$ when computing $h$.
Note that I have also implemented the ElGamal system as described in the book, but I would like to go with the implementation from the article since it makes more sense to me and I would like to not use external libraries).
My question is, what is the commitment I should generate and how can I later verify it?