Method for performing public-key cryptography

Abstract: The RSA algorithm is a known public-key method and block cipher. The algorithm is based on the assumed difficulty of factoring large composite numbers using digital computation means. The cipher keys are mathematically derived using two large prime numbers p and q. The prime numbers must meet certain properties. But a time consuming modular exponentiation is needed. The speed is improved by modifying the definition of the ciphertexts in such a way that Montgomery-like multiplication resources and modified Square-and-Multiply procedure can be used.

Description: The present invention relates to a method for performing public-key cryptography, e.g. in pay TV systems. Background The RSA algorithm (Rivest, Shamir, Adelman, "A method for obtaining digital signatures and public-key cryptosystems", Communications of the ACM, Vol 21, No 2, pp 120-126, 1978) is a known public-key method and block cipher. The algorithm is based on the assumed difficulty of factoring large composite numbers using digital computation means. The cipher keys are mathematically derived using two large prime numbers p and q. The prime numbers must meet the following properties to ensure adequate security of the algorithm: 1. p and q must be at least 512 bit long; 2. The length of p and q should differ by a few digits; 3. The Greatest Common Divisor (GCD) of (p-1) and (q-1) should be small; 4. Both, (p-1) and (q-1) should have large prime factors; 5. p = af + 1 and q = bg + 1, where f and g are large prime numbers and a and b are small prime numbers; 6. Choose f and g such that f = hw + 1 and g = jv + 1, where w and v are large prime numbers. A large secret key SK is chosen such that the GCD with SK and the product of the primes, each minus one, is one: GCD (SK, (p-1)(q-1)) = 1. ((p-1)(q-1) is known as the Euler Phi function of p and q) A public key PK is then derived by finding a number that is a multiplicative inverse of PK modulo the Euler Phi Function: PK*SK = 1 mod (p-1)(q-1). The ciphering function first breaks the data into blocks of 2 or more characters M 1 ,...M t and assigns integer values C i to each block. Next the block is raised to the power of a cipher key (PK) and has the modulus taken with respect to p*q = n. Thus, encrypting can be expressed as: C i = (M i ) PK mod n for i=1 to t; and decrypting as: M i = (C i ) SK mod n for i=1 to t. The predominant computational task in performing the RSA is the modular exponentiation, that is, given X, b and n, compute Y = X b mod n. The most classical method for doing so is the so-called Square-and-Multiply algorithm. Denoting by b[i] the i th bit of b (with b[0] as LSB) the algorithm is the following: It can be easily proved that Square-and-Multiply(X, b, n) = Y as defined above. There exist some modular multiplication methods (e.g. Montgomery, "Modular Multiplication without Trial Division", Mathematics of Computation, Vol 44, pp 519-521) that compute the product A*B*I mod n, where A and B are the two numbers to multiply and I is a constant parasite factor depending on n. The behaviour of such a computional resource is therefore: ModMul(A, B, n) = A*B*I mod n. Obviously, with a couple of multiplications, one might get rid of the parasite factor I. Namely, this is done by: ModMul(1/I 2 , ModMul(A, B, n), n) = ModMul(1/I 2 , A*B*I, n) = A*B*I*(1/I 2 )*I = A*B mod n But this double multiplication has two disadvantages: It takes the double of the time requested by ModMul. One have to store somewhere the precalculated value 1/I 2 mod n. Invention It is one object of the invention to disclose a method to speed up the computation time and to avoid an additional storing of a value like 1/I 2 mod n. This object is reached by the method disclosed in claim 1. The RSA improvement is done by modifying the definition of the Ciphertexts in such a way that their computation will be much quicker by using Montgomery-like multiplication resources. Similarly, Diffie-Hellman keys (described in: Diffie and Hellman, "New directions in Cryptography", IEEE Transactions on Information Theory, Vol IT-22, pp. 644-654, 1976) can be computed in an analogously different way. The two disadvantages mentioned above are overcome by modifying the Square-and-Multiply computation routine in the following way: It can be easily shown that the mathematical behavior of NewExp is: NewExp (X, b, n) = X b I b-1 mod n. In the inventive cryptosystem keys are computed as in the RSA but the enciphering of a message M is done by: NewExp(M, PK, n) = M PK I PK-1 mod n = C and deciphering is done by: NewExp(C, SK, n) = M The deciphering is correct since: NewExp(C, SK, n) = C SK I SK-1 mod n = (M PK I PK-1 ) SK I SK-1 mod n = M PK*SK I SK(PK-1) = (M I PK*SK )/I = M I/I = M. The proposed new method is as secure as the original RSA method, since the operations done for encrypting a message are exactly the same as encrypting by an original RSA the message MI (which yields(MI) PK mod n) and then dividing (modulo n) the so-obtained ciphertext by I (which I is a public value whatsoever). In principle the inventive method is suited for performing public-key cryptography comprising a sender device SEN and a receiver device REC having: RAM means and/or non volatile memory means; an RSA composite modulus n = p*q recorded in said non-volatile memory means, where p and q are large prime numbers; independent computation and communication capabilities; a public key PK recorded in the memory means of SEN; a secret key SK recorded in the memory means of REC; PK and SK computed according to RSA, whereby: SEN enciphers a message M by computing C = M PK I PK+z-1 mod n; REC deciphers the ciphertext C by computing M = C SK I SK+z-1 mod n; I is a constant depending on n; z is a solution of the equation z(SK+1) = 0 mod (p-1)(q-1). Advantageous additional embodiments of the inventive method are resulting from the respective dependent claims. It is a further object of the invention to improve the method of Diffie and Hellman. This object is reached by the method disclosed in the respective further independent claim. In principle this inventive method is suited for secure key exchange between a first and a second device, wherein a prime modulus p and an exponentiation base A are decided beforehand and a first hardware or software computational resource NewExp(X, b, n) is used, whereby: for all X, b and n: NewExp(X, b, n) = X b I b+z-1 mod n with z = 0; said first device selects a first random number y and computes the value v = A y I y-1 mod p = NewExp(A, y, p); said second device selects a second random number x and computes the value w = A x I x-1 mod p = NewExp(A, x, p); said first device sends v to said second device and said second device sends w to said first device; said first device computes K = NewExp(w, y, p) = A xy I xy-1 mod p; said second device computes K = NewExp(v, x, p) = A xy I xy-1 mod p. Advantageous additional embodiments of the inventive method are resulting from the respective dependent claims. Preferred embodiments It is also possible to modify the NewExp procedure in order to integrate already a starting value for VAR2. In such a case, one may compute in advance the starting value of VAR2 in such a way that the RSA will still work (i.e. NewExp(NewExp(M, PK, n) n),SK, n) = M). Advantageous starting values for VAR2 are certain powers of I, say VAR2 = I z mod n : Since for all M one should have the relation: M = (M PK I PK+z-1 ) SK I SK+z-1 = M PK*SK I PK*SK+z*SK-SK+SK+z-1 = M I z*SK+z = M I z(SK+1) mod n, the following is required: 0 = z(SK+1) mod (p-1)(q-1). A trivial solution of this equation is z = 0 (i.e. the original NewExp algorithm) but one may chose as well another solution for z. For instance, if p = SK = PK = 3 and q = 5, then z = 2 is a possible value that yields correct RSA operations since z(SK+1) mod (p-1)(q-1) = 2(3+1) mod 2*4 = 8 mod 8 = 0. Diffie and Hellman proposed a well-known key distribution scheme mentioned above, which is based on the discrete logarithm problem. In their original scheme, both sides decide about a common constant A and a prime number p. Then the first user chooses a random number x, computes A x mod p = w and sends this value to the second user. The second user chooses a random number y, computes v = A y mod p and sends this value to the first user. Both users recover the same secret key K = A x*y mod p by computing: First user: v x = (A y ) x mod p = K Second user: w y = (A x ) y mod p = K The inventive method can also be used for computing the common key K. This computation is based on the NewExp procedure described above: The first user chooses a random number x, computes w = NewExp(A, x, p) = A x I x-1 mod p and sends this value to the second user. The second user chooses a random number y, computes v = NewEx-p(A, y, p) = A y I y-1 mod p and sends this value to the first user. Both users recover the same secret key K = A x*y I x*y-1 mod p by computing : First user: K = NewExp(v, x, p) = v x I x-1 mod p = (A y I y-1 ) x I x-1 mod p = A x*y I x*y-1 mod p. Second user: K = NewExp(w, y, p) = w y I y-1 mod p = (A x I x-1 ) y I y-1 mod p = A x*y 1 x*y-1 mod p. The invention can be used in public-key cryptosystems, e.g. in a pay TV system, which comprise a sender device SEN (e.g. a verifier in a pay TV decoder) and a receiver device REC (e.g. a smart card), both having RAM means and non volatile memory means (eg. ROM, EPROM or EEPROM) containing recorded therein an RSA composite modulus n, and computation means and communication interface means (e.g. a smart card reader) between devices SEN and REC. Only 60% of the computation time for the known methods is necessary for the inventive method. Advantageously simple types of microprocessors can be used.

Claims: Method for performing public-key cryptography between a sender device SEN and a receiver device REC having: RAM means and/or non volatile memory means; an RSA composite modulus n = p*q recorded in said memory means, where p and q are large prime numbers; independent computation and communication capabilities; a public key PK recorded in the memory means of SEN; a secret key SK recorded in the memory means of REC; PK and SK computed according to RSA, characterized in that: SEN enciphers a message M by computing C = M PK I PK+z-1 mod n; REC deciphers the ciphertext C by computing M = C SK I SK+z-1 mod n; I is a constant depending on n; z is a solution of the equation z(SK+1) = 0 mod (p-1)(q-1). Method according to claim 1, characterized in that for computing C and M a first hardware or software computational resource NewExp(X, b, n) is used, whereby: for all X, b and n: NewExp(X, b, n) = X b I b+z-1 mod n; C is computed by C = NewExp(M, PK, n); M is recovered from C by M = NewExp(C, SK, n). Method according to claim 1 or 2, characterized in that z = 0. Method for secure key exchange between a first and a second device, wherein a prime modulus p and an exponentiation base A are decided beforehand, characterized in that a first hardware or software computational resource NewExp(X, b, n) is used, whereby: for all X, b and n: NewExp(X, b, n) = X b I b+z-1 mod n with z = 0; said first device selects a first random number y and computes the value v = A y I y-1 mod p = NewExp(A, y, p); said second device selects a second random number x and computes the value w = A x I x-1 mod p = NewExp(A, x, p); said first device sends v to said second device and said second device sends w to said first device; said first device computes K = NewExp(w, y, p) = A xy I xy-1 mod p; said second device computes K = NewExp(v, x, p) = A xy I xy-1 mod p. Method according to any of claims 2 to 4, characterized in that said first computational resource NewExp(,,) is a square-and-multiply exponentiation function where modular multiplications were replaced by a second computational resource ModMul(A, B, n) = A*B*I mod n; the accumulator variable of the square-and-multiply exponentiation function was pre-initialized with the value I z mod n. Method according to any of claims 2 to 5, characterized in that said first computational resource works according to the following algorithm: set a first variable in said RAM means to VAR1 = X; set a second variable in said RAM means to VAR2 = I z mod n; while (b is not equal to zero) return VAR2 as a final result. Method according to claims 5 or 6, characterized in that said second computational resource works according to the Montgomery algorithm for modular multiplication. Method according to any of claims 4 to 7, characterized in that said modulus n and/or said prime number p and/or said exponentiation base A are about 512 bits long.

Inventors: NACCACHE DAVID, NACCACHE, DAVID
Applicants: THOMSON MULTIMEDIA SA, THOMSON MULTIMEDIA
Application year: 1993
Main classification: H04L9
IPC codes: H04L9, G06F7