ElGamal1985 Chapter APublicKeyCryptosystemAndASign
ElGamal1985 Chapter APublicKeyCryptosystemAndASign
ElGamal1985 Chapter APublicKeyCryptosystemAndASign
TaherElGamal'
Hewlett-Packard Labs
1501 Page Mill Rd
Palo Alto CA 94301
A new signature scheme is proposed together with an implementation of the Diffie Eell- -
man key distribution scheme that achieves a public key cryptosystem. The security of both
systems relies on the d i f h u l t y of computing discrete logarithms over finite flelds.
1. 1NTRODUCTION
In 1976. Diffie and Hellman [3] introduced the concept of public key cryptography. Since
then, several attempts have been made to flnd practical public key systems (see for example
[8.7.9]) depending on t h e dwiculty of solving some problems. For example, the RSA system
[9] depends on the difficulty of factoring large integers. This paper presents systems that
rely on the difficulty of computing logarithms over finite flelds.
G.R. Blakley and D. Chaum (Eds.): Advances in Cryptology - CRYPT0 '84, LNCS 196, pp. 10-18, 1985.
0 Springer-Verlag Berlin Heidelberg 1985
11
Section 5 gives some properties of the system. Section 6 concludes and gives some remarks.
-
First. the Diffie Hellman Key distribution scheme is reviewed. Suppose that A and B
want to share a s e c r e t K m where A has a secret 2".and B has a secret ZB. Let p be a large
prime and a be a primitive element m o d p , both known. A computes yA = a" mod p , and
sends YA. Similarly B computes y~ = a=* n o d p and sends yB. Then the secret K m is com-
puted a s
KAB= a ~ A mud
~ Bp
= yAz* m o d p
=v
~ mod
= ~p .
Hence both A and B a r e able to compute Ka. But for an intruder computing K a appears t o
be difficult. Note t h a t i t is not yet proved that breaking the system is equivalent to computing
discrete logarithms. For more details refer to [3].
In any of the cryptographic systems that are based on discrete logarithms, p must be
chosen such t h a t p - 1has at least one large prime factor. If p - 1 has only small prime fac-
tors, then computing discrete logarithms is easy (see [a]).
Now suppose that A rants t o send B a message m . where 0 d rn p - 1. First A chooses
a number k uniformly between 0 and p - 1. Note that k wiU serve as the secret ZA in the key
distribution scheme. Then A computes the "key"
K = y~~ m o d p , (1)
where = as# nrod p is either in a public file, o r is sent by B. The encrypted message (or
ciphertext) is t h e n t h e pair ( c c ), where
Note that t h e size of the ciphertext is double the size of of the message. Also note t h a t
the multiplication operation in (2) can be replaced by any other invertible operation such a s
addition mod p.
"he decryption operation splits into 2 parts. The f i s t step is recovering K. which is easy
for B since K = ( a* )'B = c y * mod p . and rBis k n o w n t o B only. The second s t e p is to divide
cg by K and recover the message m .
The public file consists of ane entry for each user. namely vt for user i (since a and p are
known for all users). I t is possible that each user chooses his own a and p , which is preferable
12
from the security point of view but that will triple the size of the public Ale.
I t is not advisable to use the same value k for enciphering more than one block of t h e
message, since if k is used more than once, knowledge of one block m, of the message
enables an intruder t o compute other blocks a s follows:
Let
cl,l = ak m o d p , c 2 , ] = m ,K m o d p ,
and
c,.~=[x*modp. ~2.2=m2K
modp.
Then 2=
m2
% mad p . and m2 is easily computed if rn
c2.2
is known.
I t can be easily seen t h a t breaking the system is equivalent to breaking the Diflte - Hell-
man distribution scheme. First. if m can be computed from c,. c2. and y. then K can also be
computed from y. c,. and c 2 (which appears like a random number since k and m are unk-
nown). That is equivalent t o breaking the distribution scheme. Second. (even if m is known)
computing k or z from clr cz. and y is equivalent to computing discrete logarithms. The rea-
son is that both r and k appear in the exponent in y and cl.
A new signature scheme is described in this section. The public dle contains the same
public keys for encrypting messages as well as verifying signatures.
The signature for m is t h e pair ( r , s). 0 4 r , s < p - I. chosen such that the equation
a" = y' T' mod p (3)
is satisfled.
B. Compute
t = ak mod p .
C. Now (3)c a n be written a s
am = as r s modp ..
whish c a n be solved for s using
m = z r + k s mod(p-1).
Equation (6) h a s a solution for s if k is chosen such that gcd ( k , p - 1 ) = 1.
3.2. The Veriflcation P r o c e d u r e
Note
As will b e shown in section 4. the value of k chosen in step A should never be used m o r e
than once. This c a n be guaranteed, f o r example. by using as a "k generator" a DES chip used
in t h e c o u n t e r mode as a stream cipher.
Note
4.1.2. Trying t o solve equations of the form (3) is always equivalent t o computing discrete
logarithms over C F ( p ) . since b o t h unknowns z , and k appear in the exponent.
' = A mod p .
r' y (7)
solving equation (7)for r is n o t yet. proved t o be at least as hard as computing d i s c r e t e loga-
rithms, but we believe that i t is not feasible t o solve (7) in polynomial time. The r e a d e r i s
encouraged t o find a polynomial time algorithm for solving (7).
one legitimate signature for one message, can generate other legitimate signatures a n d mes-
sages. This a t t a c k does n o t allow t h e intruder t o sign an arbitrary message and t h e r e f o r e
does not break the s y s t e m . This p r o p e r t y exists in all the existing digital signature s c h e m e s
and c a n be avoided by e i t h e r requiring t h a t m has to be of certain structure, or by applying a
15
am = yr T' mod p .
Select integers A , 8.and C arbitrarily, such that ( A r 0 ) -
is relatively prime t o p - 1. Set
r ' = r AaBy c m o d p .
= ~ r ' / ( A r- CS) mod (p - 1).
S'
and m' = r ' ( h + Bs)/(Ar - [=s) mod (p - 1).
Then it is claimed t h a t ( r ' , s ' )signs the message (m'). Calculate
-' = tlr'(tA aB yC)m'/(k - Q)
yr'
- (yr'Av -r'D +r'0 rkr' a 8 h ' ) I / ( A r - a)
=((vr +)k*a h r ' ) 1 / ( , 4 r -a)
**w*
=&(w -0)
=a"' (dlcalculations mod p).
As a special case, setting A = 0.legitimate signatures can be generated with corresponding
messages without ever seeing any signatures:
r *= a B y c mod p .
s ' = - T ' / C m o d @ -1).
m ' = - r ' B / C mod (p 1). -
It can be shown t h a t ( r ' . ~ signs
') (m').
Let m be t h e number of bits in either p for the discrete logarithm problem. or TI for the
integer factoring problem. Then t he best known algorithm for both computing discrete loga-
rithms and factoring integers (which is the function used in some of the existing systems such
a the RSA system [Q]) is given by (see [ 1.5.101)
O(exp-Jcrn h r n 1 , (8)
where t h e best estimate for c is c = 0.89 for factoring
integers, (due to Schnorr and Lenstra
[lo]). as well as for discrete logarithms over GF@) (see [ 5 ] ) . These estimates imply that we
have to use numbers of about the size of the numbers used in the RSA system to obtain the
same level of security (assuming the current value for c for both the discrete logarithms
problem and t h e integer factorization problem). So, the size of the public file is larger than
that for the RSA system. (For the RSA system. each user has one entry n as his public key
together with t h e encryption key in the public file.)
16
As shown above our system has some differences with the other known systems. First,
due to the randomization in the enciphering operation, the cipher text for a given message m
is not repeated, i.e. if we encipher the same message twice we will not get the same cipher
text [C 1 , cpj. This prevents attacks like a probable text attack where if the intruder suspects
that the plain text is, for example, rn. then he tries to encipher rn and Ands out if it was
really m. This attack. and similar ones, will not succeed since the original sender chose a
random number k for enciphering, and different values of k will yield diflerent values of
Ic, , ce{. Also. due to the structure of our system, there is no obvious relation between the
enciphering of m,.m2. and m ,m2, or any other simple function of m, and mz.T h i s is not the
case for the known systems, such as the RSA system.
Suppose t h a t p is of about the same size as that required for n in the case of the RSA
system. Then t h e size of t h e cipher text is double the size of the corresponding RSA cipher
text.
For the enciphering operation two exponentiations are required. That is equivalent t o
about 2 log p multiplications in GF(p). For the deciphering operation only one exponentia-
tion (plus one division) is needed.
For the signature scheme using the above arguments for the sizes of the numbers in our
system and the RSA system, the signature is double the size of the document. Then. the size
of the signature is of t h e s a m e size as that needed for the RSA scheme, and half the size of the
signature for the new signature scheme t h a t depends on quadratic forms published by Ong
and Schnorr[B]. and also Ong,Schnorr. and Shamir[7] (since both systems are based on t h e
integer factoring problem). The Ong-Schnorr-Shamir system has been broken by Pollard and
new variations are being suggested. Thus it is not clear at the present time whether a secure
system based on modular equations can be found and hence no further remarks will be made
regarding these schemes.
For the signing procedure. one exponentiation (plus a few multiplications) is needed. To
verify a signature. it s e e m s t h a t t h r e e exponentiations are needed, but it was pointed t o the
author by A. Shamir t h a t only 1.675 exponentiations are needed. This is done by representing
17
the three exponents m , r , s in their binary expansion. A t each step square the number
u- 'yr and divide by the necessary factor t o account for the different expansions of rn, f , and
s. The different multiples of a- , y , and T can be stored in a table consisting of eight
entries. We expect t h a t 0.875 of the time a multiplication is needed. That accounts for the
1.875 exponentiations needed.
The paper described a public key cryptosystem and a signature scheme based on t h e
difficulty of computing discrete logarithms over flnite flelds. The systems are only described
in G F f p ) . The public key system can be easily extended to any GF(pm), but due to recent
progress in computing discrete logarithms over GF(pm), where m is large (see [ 2 . 5 ] ) ,it is
advisable t o use G F ( p ) instead since it seems that it is harder to compute logarithms over
G F ( p ) than over CF(gm) for large rn if p and q m are of the same size. The subexponential
time algorithm has been extended to GF($) [4] and it appears that it can be extended to all
finite fields. Hence. it seems t h a t it is better to use G F ( p ) for implementing any crypto-
graphic system. The estimates for the running time of computing discrete logarithms and
factoring integers are the best known so far. These estimates imply that the public fle size is
larger in this scheme than in the RSA scheme, but the difference is a t most a factor of two
due t o t h e structure of both schemes. Also the size of the cipher text is double t h a t of the
RSA system.
ACKNOWLEDGEMENT
The author would like t o thank a referee for including the attack described in section
4.2.3.
REFERENCES
[ l ] L. Adleman, A Subexponential Algorithm for the Discrete Logarithm Problem with Appli-
cations t o Cryptography, Proc. 20th IEEE Foundations of Computer Science Symposium
(1979). 55-50.
[2] D. Coppersmith. Fast Evaluation of Logarithms in Fields of Characteristic two, IEEE Tran-
sactions on Information Theory IT-30(1964), 587-594.
18
[9] R. Rivest, A. Shamir, a n d L Adleman, A Method for Obtaining Digital Signatures a n d Public
Key Cryptosysterns. Communications of t h e ACM. Feb 1978, volume 21. n u m b e r 2. 120-
128.
[lo] C. S c h n o r r and H. W. Lenstra 3r.. A Monte Car10 Factoring Algorithm with Finite Storage.
t o a p p e a r i n Mathematics of Computation.