Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Internet.Security

.pdf
Скачиваний:
47
Добавлен:
10.02.2015
Размер:
3.75 Mб
Скачать

190

 

INTERNET SECURITY

Example 5.152

Let3 p = 17. Choose a = 1

and b = 5 such that the elliptic curve over

Z17

becomes y

x + x + 5 (mod 17).

 

4a3

+ 27b2 = 4 + 675 = 679 ≡ 16 (mod 17)

 

Hence the given equation is indeed an elliptic curve.

1.Let P = (3, 1) and Q = (8, 10) be two points on the EC. Then P + Q = R(x3, y3) is computed as follows:

P + Q = (3, 1) + (8, 10)

 

y

 

y

2

 

 

 

 

 

x3 =

2

1

x1

x2

x

x

 

 

2

1

 

 

 

9

 

2

 

Y

=

− 3 − 8

 

5

 

 

Since 9

×

5−1

(mod 17)

=

9

×

7 (mod 17)

12, it gives

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

L=

 

 

 

 

x3 = (122 − 3 − 8) (mod 17) ≡ 14

F

 

 

 

 

 

 

 

 

 

 

9

 

× (3 − 14) = −1M+ 12 × (−11) = −133 (mod 17) ≡ 3

 

 

y3 = −1 +

 

 

 

 

5

 

 

Hence P + Q = R(14, 3).

 

A

 

 

 

 

 

 

2.

Let P = (3, 1). Then 2PE= P + P = (x3, y3) is computed as follows:

 

 

2P = (3, 1) + (3,

T

 

 

 

 

 

 

 

 

 

 

 

1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

3x12 + a

 

2

 

2x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

 

 

2y1

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

27 + 1

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

= 142 − 6 = 196 − 6 = 190(mod 17) ≡ 3

 

 

 

 

 

and

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

y

 

= −

y

1 +

 

 

3x12 + a

 

(x

 

x

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

 

 

 

2y1

 

 

 

1

 

3

 

 

 

 

 

 

 

 

 

 

 

 

 

= −1 + 14(3 − 3) = −1(mod 17) ≡ 16

 

 

 

 

 

 

 

Hence 2P = (3, 16).

 

0 < z < p

 

 

 

(z, p)

 

1

 

z

 

 

 

If

P

is an odd prime,

, and gcd

=

, then

is called a quadratic residue

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

modulo p if and only if y

 

 

z (mod p) has a solution for some y; otherwise z is called

a quadratic nonresidue.

For example, the quadratic residues modulo 13 are determined as follows:

Z13 = {1, 2, 3, . . . , 12}

Team-Fly®

zp−1

ASYMMETRIC PUBLIC-KEY CRYPTOSYSTEMS

191

The square of the integers in Z13 for modulo 13 is computed as:

{12, 22, 32, . . . , 112, 122} (mod 13) = {1, 3, 4, 9, 10, 12}

Hence the quadratic nonresidues modulo 13 are {2, 5, 6, 7, 8, 11}. Now you can see that the set Z13 = {1, 2, 3, . . . , 12} is equally divided into quadratic residues and nonresidues. In general, there are precisely (p − 1)/2 quadratic residues and (p − 1)/2 quadratic nonresidues of p.

Euler’s criterion

Let p be an odd prime and gcd(z, p) = 1. Using Fermat’s theorem zp−1 ≡ 1 (mod p), or − 1 ≡ 0 (mod p), it gives (z(p−1)/2 − 1)(z(p−1)/2 + 1) ≡ 0 (mod p) from which z is a quadratic residue of p if z(p−1)/2 ≡ 1 (mod p); and a quadratic nonresidue of p if and

only if z(p−1)/2 ≡ −1 (mod p).

Legendre symbol (z/p)

If p > 2 is a prime, 0 < z < p, and gcd(z, p) = 1, the Legendre symbol (z/p) is a characteristic function of the set of quadratic residues modulo p as follows:

 

 

z

 

1

 

if z is a quadratic residue of p

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

if z is a quadratic nonresidue of p

 

 

 

 

 

 

 

 

 

 

 

p =

 

 

 

 

 

 

 

 

 

Example 5.16

Let

p

=

17, a

=

6 and b

=

5

.

Then the elliptic curve (EC) is defined as

y

2

x

3

 

 

 

 

 

3

 

 

2

= 1539 (mod 17) ≡ 9, so the given EC

 

 

+ 6x + 5 over Z17. Note that 4a

 

+ 27b

 

is indeed an elliptic curve. The points in EC(Z

17)

 

2

{ } 3

{

 

 

 

 

}

 

 

 

are

0

(2, 5), (2,

12), . . . , (16, 10) .

Let’s first determine the points on EC. Compute y

 

= x

5 (

mod 17

)

for each

 

+ 6x +

3

 

 

possible x Z17. It will be necessary to check whether or not z x

 

+ 6x + 5 (mod 17)

is a quadratic residue for a given value of x. If z is a quadratic residue, then y can be computed by solving y2 z (mod 17).

For x = 0, then z = 5. Hence 5(p−1)/2 (mod z) ≡ 58 (mod 17) ≡ 16 (mod 17) ≡ −1 (quadratic nonresidue)

For x = 1, then z = 12. Hence 128 (mod 17) ≡ 16 (mod 17) ≡ −1 (quadratic nonresidue) For x = 2, then z = 25. Hence 258 (mod 17) ≡ 1 (quadratic residue)

Then, solving y2 ≡ 25 (mod 17), we obtain y = 5 and y = 12. Two points on the elliptic curve are found as (x, y): (2, 5) and (2, 12).

Check: 52 (mod 17) = 25 (mod 17) ≡ 8 and 122 (mod 17) = 144 (mod 17) ≡ 8. Hence, y = 5 and y = 12 are checked as two solutions.

Continuing in this way, the quadratic residues and the remaining points on the EC can be computed as shown in Table 5.11.

Let EC be an elliptic curve over Zp. Hasse states that the number of points on an elliptic curve, including the point at infinity O, is #EC(Zp) = p + 1 − t where |t| 2p.

#EC(Zp) is called the order of EC and t is called the trace of EC.

192 INTERNET SECURITY

Table 5.11 Quadratic residues and points on EC y2 = x3 + 6x + 5 = z over Z17

x

z (mod 17)

Quadratic residue

Point (x, y) on EC

 

 

z(p−1)/2 ≡ 1

 

 

 

 

 

or (z/p) = 1

 

 

 

0

5

−1

 

1

12

−1

 

2

8

1

(2,

5)

(2, 12)

3

16

1

(3,

4)

(3, 13)

4

8

1

(4,

5)

(4, 12)

5

7

−1

 

6

2

1

(6,

6)

(6, 11)

7

16

1

(7,

4)

(7, 13)

8

4

1

(8,

2)

(8, 15)

9

6

−1

 

10

11

−1

 

11

8

1

(11,

2)

(11, 15)

12

3

−1

 

13

2

1

(13,

6)

(13, 11)

14

11

−1

 

15

2

1

(15,

6)

(15, 11)

16

15

1

(16,

7)

(16, 10)

 

 

 

 

 

 

Example 5.17 Let EC be the elliptic curve y2 x3 + x + 6 over Z11. All points on EC can be determined as:

EC(Z11) = {(2, 4), (2, 7), (3, 5), (3, 6), (5, 2), (5, 9),

(7, 2), (7, 9), (8, 3), (8, 8), (10, 2), (10, 9)} {O}

Any point other than the point at infinity can be a generator G of EC. If we pick G = (8, 3) as the generator, the multiples of G can be computed as follows:

 

When P = 2Q, 2G = (8, 3) + (8, 3). Using x3 = β2 − 2x1

and y3 = −y1 + β(x1 x3)

where β

=

 

3x1

+ a

(mod p), 2G(x

, y

 

) is computed as follows:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2y1

 

 

 

 

 

 

 

3

 

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Since β

=

3 × 82 + 1

(mod 11)

1, x

3 =

12

16 (mod 11)

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

×

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

and y3 = −3 + 1(8 − 7) (mod 11) ≡ 9.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hence 2G = (7, 9).

 

+

(8, 3)

 

 

 

 

 

 

 

 

 

P

=

2G

 

 

Q

=

G

 

 

 

 

 

 

 

 

 

7, 9)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For 3G = 2G + G = (2

 

 

 

 

, it may be expressed as

 

 

 

and

 

 

. Since

P = Q, we use x3 = β

x1 x2 and y3 = −y1 + β(x1 x3) where β = (y2 y1)/(x2

1

 

 

 

 

 

 

 

 

 

= 7 − 8

 

 

 

 

 

 

3 =

 

 

 

 

 

 

 

 

x

). Compute β first as: β

 

9

3

(mod 11)

 

 

5. Thus, x

 

 

52

 

 

7

 

8

(mod 11)

 

10

 

 

 

 

 

 

 

 

 

 

 

 

and y3 = −9 + 5 (7 − 10) (mod 11) ≡ 9. Hence 3G = (10, 9).

ASYMMETRIC PUBLIC-KEY CRYPTOSYSTEMS

193

Continuing in this way, the remaining multiples are computed as shown below:

G = (8, 3) 2G = (7, 9)

3G = (10, 9) 4G = (2, 4) 5G = (5, 2) 6G = (3, 6)

7G = (3, 5) 8G = (5, 9)

9G = (2, 7) 10G = (10, 2) 11G = (7, 2) 12G = (8, 8)

The generator G = (8, 3) is called a primitive element that generates the multiples.

Elliptic curve over finite field GF(2m)

An elliptic curve over GF(2m) is defined by the following equation:

y2 + xy = x3 + ax 2 + b

m

 

m

) consists of all points

where a, b GF(2m) and b = 0. The set of EC over GF(2

 

(x, y), x, y GF(2

), that satisfy the above defining equation, together with the point

of infinite O.

Addition

Adding points on an EC over GF(2m) will give a third EC point. The set of EC points forms a group with O (point of infinity) serving as its identity. The algebraic formula for the sum of two points and the doubling point are defined as follows:

1. If P EC(GF(2m)), then P + (P ) = O, where P = (x, y) and P = (x, x + y) are indeed the points on the EC.

2.If P and Q (but P = Q) are the points on the EC(GF(2m)), then P + Q = P (x1, y1) +

Q(x2, y2) = R(x3, y3), where x3 = λ2 + λ + x1 + x2 + a and y3 = λ(x1 + x3) + x3 +

 

y

 

, where λ

=

(y

1 +

y

)/(x

1 +

x ).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.

 

1

 

 

 

 

2

 

2 m

)), but (P = −P ), then the point of doubling is

If P is a point on the EC (GF(2

 

 

2P = R(x3, y3), where

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

b

 

 

 

 

 

 

 

 

 

 

y1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x3 = x12 +

 

 

 

and y3 = x12 +

x1 +

 

x3 + x3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x2

 

 

x1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example 5.18

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

p(x)

=

x4

+

x

+

1

 

 

 

 

 

 

 

 

Consider GF(2 ) whose primitive polynomial is 4

 

 

 

 

 

 

 

of

degree 4. If α is a root of p(x), then the field elements of GF(2

) generated by p(x)

are

shown in

Table 5.12. Since p(α)

=

α4

+

α

+

1

=

0,

i.e. α4

=

α

+

1,

 

the field

ele-

ments of GF(2

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(0100), α

2

 

 

) are expressed by four-tuple vectors such as 1

=

(1000), α

=

 

=

(0010), . . . , α14 =4

 

(1001).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

Choosing a = α

 

 

and b = 1, the EC equation over GF(2

 

) becomes

 

 

 

 

 

 

 

 

 

 

 

 

y2 + xy = x3 + α4x2 + 1

194

 

INTERNET SECURITY

 

 

 

 

 

Table 5.12 Field elements of GF(24 ) using α4 = α + 1

 

 

 

αi , 0 i 14

Polynomial expression

 

Vector form

 

 

 

 

 

 

 

 

 

 

 

 

 

α0

1

 

 

 

 

1

0

0

0

 

α1

α

 

 

 

 

0

1

0

0

 

α2

 

α2

 

 

0

0

1

0

 

α3

 

 

 

α3

0

0

0

1

4

1 + α

 

 

 

 

1

1

0

0

 

α5

2

 

 

 

α6

α +

α2

 

3

0

1

1

0

 

α7

1 + α +

α

 

+ α3

0

0

1

1

 

α8

 

2

α

 

1

1

0

1

 

α9

1 +

α

 

 

3

1

0

1

0

 

α10

α +

2

α

 

0

1

0

1

 

α11

1 + α +

α2

 

3

1

1

1

0

 

α12

α + α2

+ α3

0

1

1

1

 

α13

1 + α + α2

+ α

3

1

1

1

1

 

α14

1 + α

 

+ α

3

1

0

1

1

 

α

1 +

 

 

+ α

1

0

0

1

Check whether one element (α3, α8) satisfies the EC equation over GF(24).

8)2 + 3)(α8) = 3)3 + α43)2 + 1

α16 + α11 = α9 + α10 + 1

(0100) + (0111) = (0101) + (1110) + (1000)

(0011) = (0011)

Thus, the points on the EC(GF(24)) are O (point at infinity) and the following 15 elements:

(0, 1)

(1, α6)

(1, α13)

3, α8),

3, α13)

5, α3)

5, α11) (α6, α8)

6, α14)

9, α10)

9, α13)

10, α)

10, α8)

12, 0),

12, α12)

Example 5.19

 

Consider the elliptic curve

y2

+8

xy

=

x3

+

α4x2

+

1

 

 

 

 

 

 

 

4

 

 

 

6

 

 

 

 

 

 

3

13

 

 

 

 

over GF(2 ) used

in Example 5.18. Then the point addition P (α

 

, α ) + Q(α , α

 

) = R(x3, y3) is computed

as follows:

 

α8 + α13

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Since λ

=

 

 

 

α, we have

x

3 =

λ2

 

+

λ

+

x

1

+

x

2

+

a

=

α2

+

α

+

α6

+

α3

+

 

 

 

 

 

4

 

 

α6

+

α3 =

 

 

 

 

6

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

= 1 and y3

 

 

 

 

 

 

 

 

 

+ 1) + 1 + α

8

= α(α

13

) + α

= α

13

 

 

α

 

= λ(x1 +13 x3) + x3 + y1 = α(α

 

 

 

 

 

 

 

 

 

 

 

 

Hence P + Q = R(1, α

).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Next, the point-doubling problem of 2P = P + P = R(x3, y3) is considered as shown

below:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x3 = x12 +

 

b

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

αi =

 

= α12 +

 

= α12 + α3

= α10

 

 

 

(Take

 

the

inverse

of αi

 

to

be

x2

α12

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

αi+15 (mod15).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ASYMMETRIC PUBLIC-KEY CRYPTOSYSTEMS

195

 

 

y1

 

 

and y3 = x12 +

x1 +

 

 

x3

+ x3

x1

= α12 +

α6 +

α8

α10 + α10

α6

= α12 + α13 + α10 = (1010) = α8

Hence 2P = R(x3, y3) = 10, α8)

5.6.2Elliptic Curve Cryptosystem Applied to the ElGamal Algorithm

As an application problem to ECC, consider the ElGamal public-key cryptosystem based on the elliptic curve defined over the prime field Zp. The ElGamal crypto-algorithm is based on the discrete logarithm problem. Referring to Table 5.5 for the ElGamal encryption algorithm, choose a prime p such that the discrete logarithm problem in Zp is intractable, and let α be a primitive element of Zp . The values of p, α and y are public, and x is secret.

y αx (mod p)

Choose a random number k such that gcd(k, p − 1) = 1. Then the encryption process of the message m, 0 m p − 1, is accomplished by the following pair (r, s):

r αk (mod p)

 

 

s (m (mod p − 1)) (yk (mod p))

 

 

For r, s

p

 

 

Z , the decryption is defined as:

 

m

s

(mod p)

 

 

 

 

 

rx

 

 

Elliptic curve cryptosystem by the ElGamal algorithm

 

 

User A

User B

Let X be the plaintext and k a

Generate B’s private key eB and a

random number. Choose X and k

 

public base point G. The public key

Compute Y = (x, y) where x = kG

is represented by (G, eBG)

Receive

and y = X + k(eBG)

 

Y = (x, y) = (kG, X + k(eBG))

Send Y to user B

 

Decryption yields X = y eBx

Many public-key algorithms, such as Diffie – Hellman, ElGamal and Schnorr, can be implemented in elliptic curves over finite fields.

Example 5.20 Suppose user B generates a private key eB = 10 and picks a base point G = (8, 3) as a generator on the EC y2 x3 + x + 6 over Z11. Then B’s public key becomes (G, eBG) = ((8, 3), 10(8, 3)) = ((8, 3), (10, 2)).

196

INTERNET SECURITY

User A wishes to send the plaintext X = (2, 4) and chooses a random number k = 5. Compute the ciphertext Y = (x, y), x, y EC

Where x = kG = 5(8, 3) = (5, 2),

y= X + k(eBG) = (2, 4) + 5(10, 2) = (2, 4) + (7, 2) = (7, 9)

Send Y = (x, y) = ((5, 2), (7, 9)) to B.

B receives Y and decrypts it as follows:

X= y eB x

= (7, 9) − 10(5, 2) = (7, 9) + (7, 9) = (2, 4)

Thus, the correct plaintext X is recovered by decryption.

5.6.3Elliptic Curve Digital Signature Algorithm

The Elliptic Curve Digital Signature Algorithm (ECDSA) was first proposed by Scott Vanstone in 1992 and was accepted in 1999 as an ANSI standard and in 2000 as IEEE and NIST standards. ECDSA is the elliptic curve analogue of DSA (see Section 5.5). Elliptic Curve Cryptosystems (ECCs) are viewed as elliptic curve analogues to the conventional discrete logarithm cryptosystems in which the subgroup of Zp is replaced by the group of points on an elliptic curve over a finite field. The security of elliptic curve cryptosystems is based on the computational intractability of the elliptic curve discrete logarithm problem. The ECDSA signature and verification algorithms are presented in this section.

Procedures for generating and verifying signatures using ECDSA are described in the following.

Domain parameters

The domain parameters for ECDSA consist of a proper elliptic curve, EC, defined over a prime field Zp of characteristic p, or an extension field GF(2m) of characteristic 2 and a base point G EC(Zp). The order of the underline finite field Zp or GF(2m) is p or 2m. A set of EC domain parameters is comprised of:

D = (q, FR, a, b, G, n, λ)

where q: A field size eitherp or 2m

FR: Field representation used for elements of Zp or GF(2m) a, b Zp or GF(2m): Two field elements that define an elliptic curve EC:

y2 = x3 + ax2 + b over Zp, p > 3

y2 + xy = x3 + ax2 + b over GF(2m), p = 2m

G: The base point,G < EC (Zp or GF(2m))

ASYMMETRIC PUBLIC-KEY CRYPTOSYSTEMS

197

n: The order of the point G, with n > 2160 (ANSI X.9.62) and n > 4q λ: The cofactor is defined as λ = #EC(Zp or GF(2m))/n.

Generation and verification of a random elliptic curve

The method for verifiably generating an elliptic curve at random is presented here to give some assurance regarding the possible future discovery of new and rare classes of weak elliptic curves.

The Case Zp

Input: A field size p (an odd prime)

Output: A bit string E of length g 160 bits and field elements a, b Zp that define an elliptic curve EC: y2 = x3 + ax 2 + b over Zp.

ALGORITHM

1.Choose an arbitrary bit string E of length g 160 bits.

2.Compute the hash code h = SHA-1(E) and let c0 be the bit stream of length v bits

obtained by taking the v rightmost bits of h, where v = t − 160 × s, t = log2 b and s = (t − 1)/160 .

3.W0 is the v-bit stream taken by setting the leftmost bit of c0 to zero.

4.The integer z whose binary expansion is the g-bit stream E.

5.For i from 1 to s: Let si be the g-bit string of the integer (z + i) mod 2g . Compute Wi = SHA-1(si ).

6.W is the bit string obtained by concatenation: W = W0||W1|| . . . ||Ws .

7.r is the integer whose binary expansion is W .

8.If r = 0 or 4r + 27 ≡ 0 (mod p), then go to step 1.

9.Choose a = 0, b = 0 Zp such that rb2 a3 (mod p). If this condition is met, then accept; otherwise reject.

10.Output (E, a, b).

11. If the bit string is W = W0||W1|| . . . ||Ws and r is the integer whose binary expansion

is given by W ,

 

then the condition for acceptance is r b2 a3 (mod p). Other-

wise, reject.

 

 

 

 

 

 

 

 

 

The Case GF(2m)

 

 

 

 

 

 

 

 

 

Where GF(2m), s = m(m − 1)/160 and v = m − 160 × s are used.

 

 

Input: A field size 2

of length g

3

160 bits and field elements a, b

 

GF(2m) that define

Output: A bit string E

 

 

2

+ xy = x

 

2

m

 

an elliptic curve EC: y

 

+ ax

 

+ b over GF(2 ).

 

 

ALGORITHM

1.Choose an arbitrary bit string E of length g 160 bits.

2.Compute the hash code h = SHA-1(E) and let b0 be the bit string of length v bits obtained by taking the v rightmost bits of h.

3.Let z be the integer whose binary expansion is the g-bit stream E.

4. For i from 1 to s: Let si be the g-bit string of the integer (z + i) mod 2g . Compute bi = SHA-1(si ).

198

INTERNET SECURITY

5.Let b be the field element obtained by concatenation as b = b0||b1|| . . . ||bs .

6.If b = 0, then go to step 1.

7.Let a be an arbitrary element of GF(2m).

8.Output (E, a, b).

9.Let b be the field element such that b = b0||b1|| . . . ||bs .

10.If b = b then accept. Otherwise, reject.

Key pair generation

An ECDSA key pair is associated with a particular set of EC domain parameters D = (q, FR, a, b, G, n, λ) that must be valid prior to key generation.

User A selects a random integer d for 1 d n − 1 and computes Q = dG where Q is A’s public key and d is A’s private key.

Choose Q = O.

Check whether a public key Q = (xQ, yQ) is properly represented by the elements of

Zp over (0, p − 1) and m-bit string over GF(2m) of 2m.

Check that Q lies on the elliptic curve defined by a and b.

Check that nQ = O.

If any check fails, then Q is invalid; otherwise Q is valid.

5.6.4ECDSA Signature Computation

In 2001, Johnson, Menezes and Vanstone jointly presented a paper on the ECDSA. The ECDSA algorithms on signature and verification are briefly introduced in this section.

User A: signature

To sign a message m, user A with EC domain parameters D and the key pair (d, Q) will take the following steps for ECDSA signature generation.

Select a random integer k, 1 k n − 1.

Compute kQ = (x1, y1) and convert x1 to an integer x1. Compute the following steps:

r x1 (mod n). If r = 0, then go to the initial step.

k−1 (mod n); and h = SHA-1(m) of m and convert this bit string to an integer e.

Compute s k−1(e + dr) (mod n). If s A’s signature for the message m is (r, s

= 0, then go to the initial step. ).

User B: verification

To verify A’s signature (r, s) on m, the user B must obtain an authentic copy of A’s domain parameters D and associated public key Q. Verify that r and s integers over [1, n − 1].

ASYMMETRIC PUBLIC-KEY CRYPTOSYSTEMS

199

Compute the message digest h = SHA-1(m) of the message m and convert this bit string to an integer e.

Compute the following steps:

w s−1 (mod n)

u1 ew (mod n) and u2 rw (mod n)

X = u1G + u2Q.

If X = O, reject the signature. Otherwise, convert the X coordinate x1 of x to an integer x1, and compute v x1 (mod n). Finally, accept the signature if and only if v = r.

Example 5.21 User A uses the EC y2 x3 + x+ 6 over Z11. Choose the key pair (d, Q) in which d = 2 (A’s private key), Q = (7, 9) (A’s public key) and k = 5 (a random integer). G = (8, 3). Compute the following steps:

kQ = 5(7, 9) = (10, 2) from which r = x1 = 10.

k−1 = 8 is the multiplicative inverse of k ≡ 5 (mod 13).

Suppose the message digest h = SHA-1(m) = 8 is an converted integer e. Compute s k−1(e + dr) (mod13)

≡ 8(8 + 2 × 10) (mod 13) ≡ 8(28) (mod 13) ≡ 3

Thus, A’s signature for m is (r, s) = (10, 3).

To verify A’s signature (r, s) on m, the following computations are required: w s−1 ≡ 3−1 (mod 13) ≡ 9

u1 ew (mod 13) ≡ 8 × 9 (mod 13) ≡ 7 u2 rw (mod 13) ≡ 10 × 9 (mod 13) ≡ 12

X = u1G + u2Q = 7(8, 3) + 12(7, 2) = (3, 5) + (2, 7) = (10, 9)

Since v = 10 = r, the signature is accepted.

Section 5.6 has covered the conceptual, but unified, presentation of the elliptic curve cryptosystems. It should be a helpful guide for the beginner to understand what the ECC algorithms are all about.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]