cat chinesert Introduction Four numbers are published: a = 7657728029668 b = 11945445123579 c = 11032393478962 d = 11562013642173 Four pairs of two digit numbers are to be encrypted. The sum w(x,y,z,u) = a * x + b * y + c * z + d * u generates the encrypted value. w = w(12,34,56,78) = 2017688969469068 This result, transmitted publicly to the originator of the public key code, may not easily be decomposed into its components. This is an example of a one way function. The originator of the code, however has access to a trapdoor which enables the decryption of w. If u = 4978449787536 and v = 17838619569241 Let o = w * u % v = 10549129864 now o % p = 12 o % q = 34 o % r = 56 o % s = 78 Mathematical foundation Let p, q, and r be three mutually prime numbers. Let m = p * q * r i * i( m / p % p , p ) where i(x,y) represents the modular inverse of x modulo y j = i( m / q % q , q ) k = i( m / r % r , r ) a = i * m / p b = j * m / q c = k * m / r if w = a * x + b * y + c * z then x = w % p y = w % q z = w % r Operational arrangement In setting up the public key arrangement, values of p, q , and r are chosen and kept secret. They are used to calculate a , b, and c. They will also be used later to invert the encryption of x , y , and z. Values for a , b , and c are published. To encode values of x , y , and z the equation w = a * x + b * y + c * z is used to form a sum of products, w. The value of w is transmitted. Any receiver who knows p , q , and r can recover the values of x , y , and z using the relationships x = w % p , y = w % q , and z = w % r. Anyone knowing only w , a , b , and c can determine x , y , and z only by and extended and difficult analysis. Numerical example If p = 97 q = 101 r = 103 Then w = 967479 * x + 629433 * y + 421271 * z Suppose x = 25 y = 75 z = 50 Then w = 92458000 Checking: x = 92458000 % 97 = 25 y = 92458000 % 101 = 75 z = 92458000 % 103 = 50 Transcript of bc script define i(x,y) { auto a, z, w w = y z = 1 while( x < w) { a = ( y / x ) + 1 w = x x = a * x % y z = z * a % y } return(z) } p = 97 q = 101 r = 103 s = 107 m = p * q * r * s i = i( m / p % p , p ) j = i( m / q % q , q ) k = i( m / r % r , r ) l = i( m / s % s , s ) a = i * m / p b = j * m / q c = k * m / r d = l * m / s u = 2231244 ^ 2 v = 4223579 ^ 2 t = i(u,v) e = a * t % v f = b * t % v g = c * t % v n = d * t % v define w(x,y,z,h) { auto p , q , r , s , m , i , j , k , l , a , b , c , d , w , e , f , g , n , t , u , v p = 97 q = 101 r = 103 s = 107 m = p * q * r * s i = i( m / p % p , p ) j = i( m / q % q , q ) k = i( m / r % r , r ) l = i( m / s % s , s ) a = i * m / p b = j * m / q c = k * m / r d = l * m / s u = 2231244 ^ 2 v = 4223579 ^ 2 t = i(u,v) e = a * t % v f = b * t % v g = c * t % v n = d * t % v w = e * x + f * y + g * z + n * h return(w) } Trace of values produced running bc script p = 97 q = 101 r = 103 s = 107 a = 21149299 b = 65211257 c = 92248552 d = 37336367 e = 7657728029668 f = 11945445123579 g = 11032393478962 n = 11562013642173 w = w(12,34,56,78) = 2017688969469068 u = 4978449787536 v = 17838619569241 t = 9074132988486 o = w * u % v = 10549129864 o % p = 12 o % q = 34 o % r = 56 o % s = 78 $