Elliptic Curve Digital Signature Algorithm: Difference between revisions

Remark added, cleaner links
No edit summary
(Remark added, cleaner links)
Line 1:
{{draft task|Cryptography}}
 
__TOC__
 
Line 4 ⟶ 6:
===Elliptic curves.===
 
An [[wp:Elliptic curveElliptic_curve|elliptic curve]] E over ℤp (p ≥ 5) is defined by an equation of the form '''y^2 = x^3 + ax + b''',
'''y^2 = x^3 + ax + b''', where a, b ∈ ℤp and the discriminant ≢ 0 (mod p), together with a special point 𝒪
together with a special point 𝒪 called the point at infinity.
called the point at infinity. The set '''E(ℤp)''' consists of all points (x, y), with x, y ∈ ℤp,
which satisfy the above defining equation, together with 𝒪.
 
Line 14 ⟶ 17:
 
The addition rule — which can be explained geometrically — is summarized as follows:
<pre>
1. P + &#119978; = &#119978; + P = P for all P &#8712; E(&#8484;p).
 
12. If P += (x, y) &#1199788712; = E(&#1199788484;p), +then inverse -P = P for(x,-y), alland P &#8712;+ E(-P) = &#8484119978;p).
 
23. IfLet P = (xxP, yyP) and Q = (xQ, yQ), both &#8712; E(&#8484;p), thenwhere inverse -P = (x,-y), and P + (-P) = &#1199788800; -Q.
Then R = P + Q = (xR, yR), where
 
3. Let P = (xP, yP) and Q = (xQ, yQ), both &#8712; E(&#8484;p), where P &#8800; -Q.
Then RxR = P&lambda;^2 +- Q = (xR,xP yR),- wherexQ
yR = &lambda;&middot;(xP - xR) - yP,
 
xR = &lambda;^2 - xP - xQ
with
yR = &lambda;&middot;(xP - xR) - yP,
 
&lambda; = (yP - yQ) / (xP - xQ) if P &#8800; Q,
with
(3&middot;xP&middot;xP + a) / 2&middot;yP if P = Q (point doubling).
</pre>
&lambda; = (yP - yQ) / (xP - xQ) if P &#8800; Q,
Remark: there already is a task page requesting &#8220;a simplified (without modular arithmetic)
(3&middot;xP&middot;xP + a) / 2&middot;yP if P = Q (point doubling).
version of the [[Elliptic_curve_arithmetic|elliptic curve arithmetic]]&#8221;.
This new page is added because modulo operations are precisely essential for implementing
[[wp:Elliptic_Curve_Digital_Signature_Algorithm|ECDSA]]: we need a discrete, finite field to play in.
 
 
===Elliptic curve digital signature algorithm.===
 
A [[wp:digital signatureDigital_signature|digital signature]] is the electronic analogue of a hand-written signature that
convinces the recipient that a message has been sent intact by the presumed sender.
Anyone with access to the public key of the signer may verify this signature.
Changing even a single bit of a signed message will cause the verification procedure to fail.
 
'''[[wp:ECDSA|ECDSA]] key generation.''' Party A does the following:<br />
1. Select an elliptic curve E defined over &#8484;p.<br />
&nbsp;The number of points in E(&#8484;p) should be divisible by a large prime r.<br />
Line 47 ⟶ 55:
 
'''ECDSA signature computation.''' To sign a message m, A does the following:<br />
1. Compute message representative f = H(m), using a cryptographic hash function.<br />
[[wp:Cryptographic_hash_function|cryptographic hash function]].<br />
&nbsp;Note that f can be greater than r but not longer (measuring bits).<br />
2. Select a random integer u in the interval [1, r - 1].<br />
Line 62 ⟶ 71:
&nbsp;Accept the signature if and only if c1 = c.
 
To be cryptographically useful, the parameter r should have at least have 250 bits.
The basis for the security of [[wp:Elliptic-curve cryptographycurve_cryptography|elliptic curve cryptosystems]] is the intractability
is the intractability of the elliptic curve discrete logarithm problem (ECDLP) in a group of this size:
given two points G, W &#8712; E(&#8484;p), where W lies in the subgroup of order r generated by G,
determine an integer k such that W = kG and 0 &#8804; k &lt; r.
Line 76 ⟶ 85:
hash value and a way to tamper with it). The program should be lenient where possible
(for example: if it accepts a composite modulus N it will either function as expected,
or demonstrate the principle of [[wp:Lenstra ellipticLenstra_elliptic-curve factorizationcurve_factorization|elliptic curve factorization]]) &mdash; but strict where required (a point G that is not on E will always cause failure).<br />
(a point G that is not on E will always cause failure).<br />
Toy ECDSA is of course completely useless for its cryptographic purpose.
If this bothers you, please add a multiple-precision version.
Line 99 ⟶ 107:
A.9 Elliptic curves: overview (p. 115)<br />
A.10 Elliptic curves: algorithms (p. 121)
 
 
=={{header|C}}==
Parallel to: FreeBASIC
<lang c>
/*
Line 447 ⟶ 457:
}
</lang>
{{outputout}}
(tcc, srand(1); first set only)
<pre>
(tcc, srand(1); first set only)
 
E: y^2 = x^3 + 355x + 671 (mod 1073741789)
base point G (13693, 10088)
Line 477 ⟶ 486:
 
=={{header|FreeBASIC}}==
Parallel to: C
<lang freebasic>
'subject: Elliptic curve digital signature algorithm,
Line 812 ⟶ 822:
system
</lang>
{{outputout}}
(randomize 1, first set only)
<pre>
(randomize 1, first set only)
 
E: y^2 = x^3 + 355x + 671 (mod 1073741789)
base point G (13693, 10088)