Undeniable signature

An undeniable signature is a digital signature scheme which allows the signer to be selective to whom they allow to verify signatures. The scheme adds explicit signature repudiation, preventing a signer later refusing to verify a signature by omission; a situation that would devalue the signature in the eyes of the verifier. It was invented by David Chaum and Hans van Antwerpen in 1989.

Overview
In this scheme, a signer possessing a private key can publish a signature of a message. However, the signature reveals nothing to a recipient/verifier of the message and signature without taking part in either of two interactive protocols:
 * Confirmation protocol, which confirms that a candidate is a valid signature of the message issued by the signer, identified by the public key.
 * Disavowal protocol, which confirms that a candidate is not a valid signature of the message issued by the signer.

The motivation for the scheme is to allow the signer to choose to whom signatures are verified. However, that the signer might claim the signature is invalid at any later point, by refusing to take part in verification, would devalue signatures to verifiers. The disavowal protocol distinguishes these cases removing the signer's plausible deniability.

It is important that the confirmation and disavowal exchanges are not transferable. They achieve this by having the property of zero-knowledge; both parties can create transcripts of both confirmation and disavowal that are indistinguishable, to a third-party, of correct exchanges.

The designated verifier signature scheme improves upon deniable signatures by allowing, for each signature, the interactive portion of the scheme to be offloaded onto another party, a designated verifier, reducing the burden on the signer.

Zero-knowledge protocol
The following protocol was suggested by David Chaum.

A group, G, is chosen in which the discrete logarithm problem is intractable, and all operation in the scheme take place in this group. Commonly, this will be the finite cyclic group of order p contained in Z/nZ, with p being a large prime number; this group is equipped with the group operation of integer multiplication modulo n. An arbitrary primitive element (or generator), g, of G is chosen; computed powers of g then combine obeying fixed axioms.

Alice generates a key pair, randomly chooses a private key, x, and then derives and publishes the public key, y = gx.

Message signing

 * 1) Alice signs the message, m, by computing and publishing the signature, z = mx.

Confirmation (i.e., avowal) protocol
Bob wishes to verify the signature, z, of m by Alice under the key, y.
 * 1) Bob picks two random numbers: a and b, and uses them to blind the message, sending to Alice:
 * 2) Alice picks a random number, q, uses it to blind, c, and then signing this using her private key, x, sending to Bob:  Note that
 * 3) Bob reveals a and b.
 * 4) Alice verifies that a and b are the correct blind values, then, if so, reveals q. Revealing these blinds makes the exchange zero knowledge.
 * 5) Bob verifies s1 = cgq, proving q has not been chosen dishonestly, and  proving z is valid signature issued by Alice's key. Note that zayb+q = (m$x$)a(gx)b+q.

Alice can cheat at step 2 by attempting to randomly guess s2.

Disavowal protocol
Alice wishes to convince Bob that z is not a valid signature of m under the key, gx; i.e., z ≠ mx. Alice and Bob have agreed an integer, k, which sets the computational burden on Alice and the likelihood that she should succeed by chance.
 * 1) Bob picks random values, s ∈ {0, 1, ..., k} and a, and sends: v$x$ = m$x$g$a$ andv$x$ = z$b+q$y$a$, where  exponentiating by a is used to blind the sent values. Note that v$b+q$ = z$x$y$1$ = (m$s$)$a$(g$2$)$s$ = v$a$$2$.
 * 2) Alice, using her private key, computes v$s$$a$ and then the quotient, v$x$$s$v$x$$a$ = (m$1$g$x$)$1$(zsgxa)$x$ = m$1$z$x$ = (m$2$z$−1$)$s$. Thus, v$a$$x$v$−1$$sx$ = 1, unless z ≠ m$−s$.
 * 3) Alice then tests v$x$$−1$v$s$$1$ for equality against the values: (m$x$z$2$)$−1$ for i ∈ {0, 1, …, k}; which are calculated by repeated multiplication of m$x$z$1$ (rather than exponentiating for each i). If the test succeeds, Alice conjectures the relevant i to be s; otherwise, she conjectures random value. Where z = m$x$, (m$2$z$−1$)$x$ = v$−1$xv$i$$x$ = 1 for all i, s is unrecoverable.
 * 4) Alice commits to i: she picks a random r and sends hash(r, i) to Bob.
 * 5) Bob reveals a.
 * 6) Alice confirms that a is the correct blind (i.e., v$−1$ and v$x$ can be generated using it), then, if so, reveals r. Revealing these blinds makes the exchange zero knowledge.
 * 7) Bob checks hash(r, i) = hash(r, s), proving Alice knows s, hence z ≠ m$x$.

If Alice attempts to cheat at step 3 by guessing s at random, the probability of succeeding is 1/(k + 1). So, if k = 1023 and the protocol is conducted ten times, her chances are 1 to 2100.