One solution is suggested by Girault, Toffin and
Vallee (Girault et al., 1988). Finding a good approx-
imation to the fraction
P
n
can be done efficiently by
developing it in continued fractions. This implies us-
ing the extended Euclidean algorithm to P and n.A
solution is found such that | z |<Zand 0 <u<U
if Z · U>n, which is the case here with Z = n
1
3
and
U =2· n
2
3
.
We then select an integer y such that
n
1
3
≤ y ≤ 2 · n
1
3
and gcd(y, z)=1. We find the non-negative integer
t<ysuch that:
t · z = −u (mod y)
which is possible since gcd(y,z)=1. Then we take
x =
u + t · z
y
≤ 4n
1
3
and obtain:
P · z = u = x · y − t · z (mod n)
which gives equation (6), with x, y, z and t being all
smaller than 4 · n
1
3
. From x, y, z, t we derive, using
(5), four messages m
1
,m
2
,m
3
and m
4
, each of size
one third the size of n:
m
1
= x + t
m
2
= y + t
m
3
= t
m
4
= x + y + z + t
(7)
Since −n
1/3
<z<n
1/3
and y ≥ n
1/3
,wehave
y + z>0, which gives using u ≥ 0
x + t =
u + t · (y + z)
y
≥ 0
which shows that the four integers m
1
, m
2
, m
3
and
m
4
are non-negative, and we have
R(m
1
).R(m
2
)=
R(m
3
).R(m
4
)(mod n)
The complexity of our attack is polynomial in the
size of n.
3 EXISTENCE OF SELECTIVE
FORGERY
The attack discussed in the previous section is exis-
tential, which means that the attacker needs to find
the four messages required for forgery. This section
deals with the possibility of a selective forgery attack,
but in this case the attack no longer runs in polyno-
mial time. Let m
3
be the message whose signature
must be forged. Letting x, y, z and t as in Lenstra A.,
Lenstra H. and Lovasz L. (Lenstra et al., 1982), we
compute two integers z and u such that
(P + t) · z = u (mod n)
with
−n
1
2
<z<n
1
3
0 <u<2 · n
2
3
We then factor u, and try to write u as the prod-
uct x · y of two integers of roughly the same size, so
that eventually we have four integers x, y, z, t of size
roughly one third of the size of the modulus, with:
x · y =(P + t) · z (mod n)
which gives again
R(m
1
).R(m
2
)=R(m
3
).R(m
4
)(mod n)
The signature of m
3
can now be forged using the
signatures of m
1
,m
2
and m
4
. For a 512-bit modulus
the selective forgery attack is truly practical. For a
1024-bit modulus the attack is more demanding but
was still implemented with success.
4 CONCLUSIONS
We have extended Girault and Misarsky’s attack on
RSA signatures with affine redundancy: we described
a chosen message attack against RSA signatures with
affine redundancy for messages as small as one third
of the size of the modulus. Consequently, when us-
ing a fixed padding P | m or m | P , the size of P
must be at least two-thirds of the size of n. Our at-
tack is polynomial in the length of the modulus. It
remains an open problem to extend this attack to even
smaller messages (or, equivalently, to bigger fixed-
pattern constants): we do not know if there exists a
polynomial time attack against RSA signatures with
affine redundancy for messages shorter than one third
of the size of the modulus. However, we think that
exploring to what extent affine padding is malleable
RSA-PADDING SIGNATURES WITH ATTACK STUDIES
99