# 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 = g$^x$.

### Message signing

* Alice signs the message, m, by computing and publishing the signature, z = m$^x$.

### Confirmation (i.e., avowal) protocol

Bob wishes to verify the signature, z, of m by Alice under the key, y.
* Bob picks two random numbers: a and b, and uses them to blind the message, sending to Alice:
    c = m$^a$g$^b$.
* Alice picks a random number, q, uses it to blind, c, and then signing this using her private key, x, sending to Bob:
    s$_1$ = cg$^q$ and
    s$_2$ = s$_1$$^x$.
Note that
    s$_1$$^x$ = (cg$^q$)$^x$ = (m$^a$g$^b$)$^x$g$^{qx}$ = (m$^x$)$^a$(g$^x$)$^{b+q}$ = z$^a$y$^{b+q}$.
* Bob reveals a and b.
* Alice verifies that a and b are the correct blind values, then, if so, reveals q. Revealing these blinds makes the exchange zero knowledge.
* Bob verifies s$_1$ = cg$^q$, proving q has not been chosen dishonestly, and
    s$_2$ = z$^a$y$^{b+q}$,
proving z is valid signature issued by Alice's key. Note that
    z$^a$y$^{b+q}$ = (m$^x$)$^a$(g$^x$)$^{b+q}$.
Alice can cheat at step 2 by attempting to randomly guess s$_2$.

### Disavowal protocol

Alice wishes to convince Bob that z is not a valid signature of m under the key, g$^x$; i.e., z ≠ m$^x$. Alice and Bob have agreed an integer, k, which sets the computational burden on Alice and the likelihood that she should succeed by chance.
* Bob picks random values, s ∈ {0, 1, ..., k} and a, and sends:
    v$_1$ = m$^s$g$^a$ and
    v$_2$ = z$^s$y$^a$,
where exponentiating by a is used to blind the sent values. Note that
    v$_2$ = z$^s$y$^a$ = (m$^x$)$^s$(g$^x$)$^a$ = v$_1$$^x$.
* Alice, using her private key, computes v$_1$$^x$ and then the quotient,
    v$_1$$^x$v$_2$$^{−1}$ = (m$^s$g$^a$)$^x$(z$^s$g$^{xa}$)$^{−1}$ = m$^{sx}$z$^{−s}$ = (m$^x$z$^{−1}$)$^s$.
Thus, v$_1$$^x$v$_2$$^{−1}$ = 1, unless z ≠ m$^x$.
* Alice then tests v$_1$$^x$v$_2$$^{−1}$ for equality against the values:
    (m$^x$z$^{−1}$)$^i$ 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$^x$z$^{−1}$)$^i$ = v$_1$$^x$v$_2$$^{−1}$ = 1 for all i, s is unrecoverable.
* Alice commits to i: she picks a random r and sends hash(r, i) to Bob.
* Bob reveals a.
* Alice confirms that a is the correct blind (i.e., v$_1$ and v$_2$ can be generated using it), then, if so, reveals r. Revealing these blinds makes the exchange zero knowledge.
* 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 2$^{100}$.