Cryptography Overview

3.The two parties exchange the public values.

These private and public values correspond to the private and public key components of a key pair. The public value is generated in such a way that computing the private value from the public number is computationally infeasible.

Phase 2

Each participant computes the agreed-upon secret key, z, using the other participant’s public value, y', their own private value, x, and the prime, p.

z= (y')x mod p

Even with knowledge of the parameters and both public keys, an outside individual will not be able to determine the secret key. You must have one of the private values to determine the secret key. This means secret information is never sent over unsecure lines.

The Math

Even though the two parties involved are making computations using different private values, they will both end up with the same secret key, as illustrated by the following.

p: prime

g: base

x1: 1st party’s private value

x2: 2nd party’s private value

y1: 1st party’s public value

y2: 2nd party’s public value

z: secret key

In Phase 1, each party computes a private value, xn, and a public value, yn:

y1 = gx1 mod p y2 = gx2 mod p

In Phase 2, the parties trade public values and compute the same secret key:

z= y2x1 mod p z = y1x2 mod p

They both compute the same z, because:

y2x1 = (gx2)x1 = (gx1)x2 = y1x2 mod p

6 4

R S A B S A F E C r y p t o - C D e v e l o p e r ’s G u i d e

Page 86
Image 86
RSA Security 5.2.2 manual Math