Post-Quantum Signature With Preimage Chameleon Hashing
Post-Quantum Signature With Preimage Chameleon Hashing
Post-Quantum Signature With Preimage Chameleon Hashing
1. Introduction
A traditional cryptographic hash function H is an algorithm that, given a message
m of any size, produces output d of fixed size, usually small compared to the size of m.
Output d is known as a digest. Finding two different messages with the same digest d
should be unlikely. In addition, it must be easy to obtain d from m, and difficult to obtain
m, given d.
Unlike the traditional hash function, a chameleon hash is a cryptographic primitive
associated with a pair of keys: the hash key and the trapdoor key. The hash key is required
to determine the hash of a message, while using the trapdoor key, it is possible to find
second-preimages. This type of hash was first proposed by [Krawczyk and Rabin 1998].
Relationships between chameleon hash and other cryptographic primitives were
shown by [Bellare and Ristov 2008], where the authors show how to construct sigma
protocols from chameleon hashes and also how some suitable sigma protocols could be
transformed in chameleon hash schemes. Mohassel [Mohassel 2011] shows how to use
chameleon hashes to build one-time signatures. In [Blazy et al. 2015] it was shown how
to construct d-times signatures from chameleon hash functions in a way that the key size
grows logarithmically as a function of d. Other applications of chameleon hashes are san-
itizable signatures [Ateniese et al. 2005], redactable blockchains [Ateniese et al. 2017],
privacy-preserving communication protocols [Guo et al. 2013] and dynamic public key
certificates [Chien 2018].
The biggest challenge to design and use chameleon hash schemes is guar-
anteeing security in a scenario where collisions computed with the trapdoor are re-
vealed. Some known constructions suffer from the key exposure problem, where an
adversary could extract the trapdoor if given access to sample collisions, as discussed
in [Ateniese and de Medeiros 2005]. Even if an adversary cannot disclose the trapdoor,
this does not guarantee that collisions do not leak information allowing an attacker to
discover new collisions.
Different chameleon hash schemes can be found in the literature adding to the
classic scheme new properties that improve collision resistance such as the secret-
coin chameleon hash [Ateniese et al. 2017], labelled chameleon hash, and identity-based
chameleon hash. The secret-coin chameleon hash is a scheme where the hash returns a
pair (d, p) with the digest and a proof that the digest is correct and uses a V ERIFY algo-
rithm to check that the digest was correctly computed, without revealing random decisions
taken while computing the hash. A labelled chameleon hash assumes that each hash uses a
unique label that should be used only once. Moreover the identity-based chameleon hash
requires interaction with a trusted third-party to derive disposable trapdoors to compute
collisions in the hash function.
2. Preliminaries
2.1. Notation
We use small caps to represent algorithms like in “K EY G EN”. Generic elements of
sets are represented by multi-letter variables in italic, like in “msg”. Natural numbers are
represented as single-letter variables in italic. Matrices are represented by an uppercase
italic A, with some numeric subscript if we need to define more than one. Vectors of
integers are represented with boldface letters like in b. Polynomials are represented by
accented letters like in “p̂” and vectors of polynomials are accented boldface letters like
“b̂”. All our polynomials have integer coefficients. The set of all vectors of integers
modulo q with n dimensions is represented by Zn . The set of all vectors with n dimensions
modulo q is Znq . Furthermore, the set of all n × m matrices of integers modulo q is Zqn×m .
When we talk about the norm ||b|| we assumepPthe euclidean norm. For vector of
m 2
polynomials b̂ we assume that its norm is ||b̂|| = i=1 ||zi || where each zi is a vector
of integers formed by the coefficients from each polynomial from b̂. Notwithstanding,
different definitions of norm can also achieve the desired results, with different trade offs.
We represent as Z[x]/(f (x)) a polynomial ring with integer coefficients and Zq [x]/(f (x))
is a polynomial ring with the coefficients being integers modulo q. Here f (x) is a monic
and irreducible polynomial.
The expression A · b is a multiplication of a matrix and a vector. The expression
a·b and â· b̂ are the dot product of two vectors. In the second case each vector component
is a polynomial and its sum and multiplication follows the usual multiplication rules for
polynomials.
• Uniformity: For all pair of messages (msg1 , msg2 ), given randomly chosen
rnd, the random variables H ASH(hk, msg1 , rnd) and H ASH(hk, msg2 , rnd) have
probability distributions computationally indistinguishable. For all construc-
tions found in the literature, this property holds statistically: not even ineffi-
cient adversaries can differentiate between the output of H ASH(hk, msg1 , ·) and
H ASH(hk, msg2 , ·) for a random rnd, except with probability negligibly next to
1/2;
• Weak Collision Resistance: The property is defined in an attacking game be-
tween a challenger and an adversary A where for all adversaries, the probability
of winning the game is negligible. The game has the following parts:
– Setup: The challenger runs (hk, tk) ← K EY G EN(1n ) and sends hk to the
adversary;
– Output: The adversary returns a distinct pair (msg 0 , rnd0 )
and (msg , rnd00 ) and wins if H ASH(hk, msg 0 , rnd0 )
00
=
00 00
H ASH(hk, msg , rnd );
• Standard Collision Resistance: The property is defined by the following attack
game which gives more power to the attacker:
– Setup: The challenger runs (hk, tk) ← K EY G EN(1n ) and sends hk to the
adversary;
– Queries: The adversary requests sample collisions sending a polyno-
mial number of p queries for the challenger. Each query has the format
(msg1i , rnd1i , msg2i ) for i ∈ {1, . . . , p}. The challenger respond for each
query with rnd2i = C OLLISION(tk, msg1i , rnd1i , msg2i ). The adversary
can choose its queries adaptively: it can choose each one after examining
the previous responses;
– Output: The adversary outputs distinct tuples (msg 0 , rnd0 ) and
(msg 00 , rnd00 ) and wins the game if H ASH(hk, msg1i , rnd1i ) =
H ASH(hk, msg2i , rnd2i ) and msg 0 6= msg 00 , msg 0 6= msg1i and msg 0 6=
msg2i for all i ∈ {1, . . . , p}.
All constructions found in the literature have proven weak collision resistance
under reasonable assumptions. Constructions with standard collision resistance are pre-
sented in [Derler et al. 2020, Camenisch et al. 2017], but with a different definition of
chameleon hash.
H ASH(hk, x, r) = A1 · x + A2 · r (mod q)
Let fA (x) = A · x mod q. Let f −1 (y) be the set of all preimages of a given y
for the function f . And let S AMPLE P RE be a probabilistic algorithm that given some
trapdoor tk (used as secret key in our chameleon phash function) and a given y, samples
one element x from f −1 (y) such that ||x|| ≤ 21 β 2 − m0 with overwhelming proba-
bility. The algorithm must not leak information about tk if many of its results are re-
vealed. Methods to define suitable matrices and the S AMPLE P RE algorithm can be found
in [Micciancio and Peikert 2012].
We can then define the C OLLISION algorithm as:
3. Our Proposal
3.1. Preimage Chameleon Hash Schemes
This proposed scheme is a tuple of 3 efficient algorithms
(K EY G EN, H ASH, P REIMAGE) defined over message space M and randomness
space R. The algorithms K EY G EN and H ASH work equal as in the simple chameleon
hash scheme. But the algorithm P REIMAGE has the following property:
• P REIMAGE is an efficient probabilistic algorithm that on input sk, msg and dgt,
outputs a rnd such that H ASH(hk, msg, rnd) = dgt.
In the literature, there are at least four chameleon hash constructions which
could be used as a preimage chameleon hash: Krawczyk and Rabin’s construction
based on trapdoor permutation functions [Krawczyk and Rabin 1998], Bellare and Ris-
tov construction based on Fiat-Shamir sigma protocol [Bellare and Ristov 2014],
Ateniese and Medeiros construction based on Nyberg-Rueppel signature
scheme [Ateniese and de Medeiros 2005] and Cash, Hofheinz, Kiltz and Peikert
construction with security based on lattice problems [Cash et al. 2010]. The first two of
them suffer from the key exposition problem: given a collision in the H ASH function,
an adversary could easily extract the secret key used in the scheme. This limits the
applicability of the first two constructions. The idea of using a scheme of chameleon
hashes with preimage computation also appeared in [Lu et al. 2019], where it was called
chameleon hash+.
Similarly to the original chameleon hash scheme, we require the uniformity prop-
erty and weak collision resistance property. But to capture the notion that this scheme
allows for first preimage computation instead of second preimage, the standard collision-
resistance could be defined with the following attack game:
• Setup: The challenger runs (hk, tk) ← KeyGen(1n ) and send hk to the adver-
sary;
• Queries: The adversary request sample preimages sending q queries for the chal-
lenger. Each query has the format (msgi , dgti ) for i ∈ {1, . . . , q}. The challenger
respond for each query with rndi such that rndi = P REIMAGE(tk, msgi , dgti ).
The adversary can adaptively choose its queries;
• Output: The adversary outputs distinct pairs (msg 0 , rnd0 ) and (msg 00 , rnd00 ), win-
ning the game if H ASH(hk, msg 0 , rnd0 ) = H ASH(hk, msg 00 , rnd00 ) and msg 0 6=
msgi and msg 00 6= msgi for all i ∈ {1, . . . , q}.
The difference in the output restriction for the adversary prevents trivial attacks
where it could compute dgt0 = H ASH(hk, msg0 , rnd0 ) over random values msg0 and
rnd0 , obtain rnd1 from the query’ (msg 0 , dgt0 ) and return (msg0 , rnd0 , msg 0 , rnd1 ) as
answer.
Notice that from a preimage chameleon hash, we can easily define a traditional
chameleon hash using the following definition for the Collision function:
C OLLISION(tk, msg, rnd, msg 0 ) = P REIMAGE(tk, msg 0 , Hash(pk, msg, rnd))
The converse is not true: one cannot necessarily generalize a chameleon hash
scheme to this preimage chameleon hash variant, as being able to compute collisions with
a trapdoor does not imply the ability to compute preimages with that trapdoor.
However, the additional power of this scheme also means that creating secure
constructions of this scheme is even more challenging than for the classical chameleon
hash scheme. If a classical chameleon hash had standard collision-resistance and we had a
P REIMAGE algorithm to compute preimages given its trapdoor, this would not necessarily
give us a preimage chameleon hash with enhanced collision-resistance. The reason is that
in the attack game defined here, we give to the adversary the power to query preimages,
something more powerful than querying for second-preimages.
The difference between this construction and what is proposed in [Mohassel 2011]
is that as here we are using preimage chameleon hashes, we verify our signature compar-
ing H ASH(hk, msg, sign) not with a randomly chosen value from D, but with any value
specifically chosen during key creation (dgt).
Algorithm 3: V ERIFY(pk, msg, sig)
1 (hk, dgt) ← pk;
2 if H ASH(hk, msg, sig) = dgt then
3 Return accept;
4 else
5 Return reject;
6 end
This opens the possibility to use this signature construction in the following new
scenarios and applications:
1. Instead of using the V ERIFY algorithm, in some contexts, the H ASH algorithm
could be used to check the validity of a signature. The verifier could extract using
H ASH(hk, msg, sign) some fixed information about the signer, which, if valid
and correct, attests the validity of the signature.
2. User-friendly digital signatures could be created to mimic the appear-
ance of a handwritten signature. A valid signature could produce with
H ASH(hk, msg, sign) a compressed image of the signer’s handwritten signature
to be shown on the screen by some software.
As the target verification value is not random, to define security, in the underlying
attack game, we require that the adversary chooses its value:
• Setup: Let Λ be any system parameters needed during key creation. The chal-
lenger send Λ to the adversary, the adversary replies with a target verification
value dgt. The challenger runs (pk, sk) ← G EN(1n , dgt) and sends pk to the
challenger.
• Queries: The adversary requests sample signatures for the messages msgi with
i ∈ {1, . . . , p}. For each message msgi requested, the challenger respond sending
sigi such that sigi = S IGN(sk, msgi ). It chooses the queries adaptively.
• Output: The adversary outputs a pair (msg, sig) and wins the game if
V ERIFY(pk, msg, sig) = accept and (msg, sig) 6= (msgi , sigi ) for all i ∈
{1, . . . , p}.
Notice that instantiating this scheme with a preimage chameleon hash with stan-
dard collision resistance ensures its security in the sense of preventing existential forg-
eries against chosen message attacks: an existential forgery yields collisions involving
new messages for the preimage chameleon hash.
• Oracle Query: For each query xi , if this value was never queried before, choose
$
ri ←− S AMPLE D OM(pk). Let hi ← d − fA2 (ri ). The algorithm stores ri in a
dictionary using xi as the key. Finally, it sends hi to A as result.
If a query xi was already made in the past, get the value ri associated with key xi
from the dictionary. Set hi ← d − fA2 (ri ) and send hi as response to A.
• Signing Query: For each query xi , look up for ri in the dictionary using xi as the
key. Send ri as the answer to A.
This part of the algorithm simulates a random oracle choosing a random signature
ri to xi and then deriving the random digest H(xi ) = di from the signature.
• Output: After all the queries, the adversary A returns a possible forgery as (x, r).
Our algorithm then searches in the dictionary a value r∗ stored with the key x. It
returns (r, r∗ ) as a collision for fA2 .
If the adversary A returned a forgery, then we have that H(x) + fA2 (r) = H(x) +
fA2 (r∗ ) (mod q). This algorithm fails if r = r∗ and succeeds otherwise. As fA2 is a
function many-to-one, in the worst case, there are only two possible values that fA2 maps
to the same result. Thus, the collision finder succeeds with at least half the probability
that A wins its attack game. If this probability is non-negligible, then so is our probability
of finding a collision.
The results of the running times are summarized in Table 1. The sizes for sig-
natures, keys, and chameleon hash digests are summarized in Table 2. As expected, our
construction has comparable performance and the same key size as a GPV signature.
The tests and implementation prove the viability of the construction. Despite
slower and with bigger keys than classical and more modern post-quantum signature
schemes, our presented construction is, at the present moment, the only one known to
implement post-quantum digital signature securely based on preimage chameleon hash.
Finding new preimage chameleon hash schemes with performance on par with modern
signature schemes is an open research problem.
6. Conclusion
In this paper, we propose a new post-quantum digital signature scheme, where the
signature is a value which (together with the message), yields via hash a value predefined
by the signatory. To do this, we use a new feature added to the traditional chameleon hash
function that allows first preimage computation using a trapdoor.
The new signature scheme, which we call the preimage signature, is proven here
to be strongly unforgeable under a chosen message attack (SUF-CMA). The proposed
scheme was coded and compared to traditional digital signature algorithms. The compar-
ison shows that the new signature algorithm is viable; that is, it can be used in practice to
sign electronic documents.
As the signature is the preimage of any value chosen by the signer during key
creation, this opens new possibilities, like creating signatures where a signed message is
verified comparing its hash after concatenated with the signature to check if the result is
a given value with some special interest, for example, a representation of a handwritten
signature. Such an approach can improve the user experience in terms of trust in the
signature, not only regarding cryptographic verification, but also visual verification by
recipients.
7. Acknowledgments