NAME
Crypt::ECDSA -- Elliptical Cryptography Digital Signature Algorithm
DESCRIPTION
Implements the pending FIPS 186-3 ECDSA standard for digital signatures using
elliptical key crytography. Like FIPS 186-3, this is preliminary-- not yet
ready for full use. It does contain a working implementation of the elliptical
key crypto found in the current 186-2 standard.
SYNOPSIS
METHODS
=item<new>
=item<key>
=item<errstr>
=item<keygen>
=item<make_text_digest>
=item<signature>
# sign is a synonym for signature
=item<sign>
# check a public key provided for validity, given a curve
=item<verify_public_key>
=item<verify>
NOTES
- See FIPS 186-3, draft standard Note the use of SHA-1 hashing is becoming deprecated, but is still the default. SHA-256 hashing may be used instead of SHA-1 when practicable.
- See also http://en.wikipedia.org/wiki/Elliptic_Curve_DSA, quoted below:
-
Signature generation algorithm Suppose Alice wants to send a signed message to Bob. Initially, the curve parameters (q,FR,a,b,G,n,h) must be agreed upon. Also, Alice must have a key pair suitable for elliptic curve cryptography, consisting of a private key dA (a randomly selected integer in the interval [1,n ? 1]) and a public key QA (where QA = dAG). For Alice to sign a message m, she follows these steps: 1. Calculate e = HASH(m), where HASH is a cryptographic hash function, such as SHA-1. 2. Select a random integer k from [1,n ? 1]. 3. Calculate r = x1(mod n), where (x1,y1) = kG. If r = 0, go back to step 2. 4. Calculate s = k ? 1(e + dAr)(mod n). If s = 0, go back to step 2. 5. The signature is the pair (r,s). Signature verification algorithm For Bob to authenticate Alice's signature, he must have a copy of her public key QA. He follows these steps: 1. Verify that r and s are integers in [1,n ? 1]. If not, the signature is invalid. 2. Calculate e = HASH(m), where HASH is the same function used in the signature generation. 3. Calculate w = s ? 1(mod n). 4. Calculate u1 = ew(mod n) and u2 = rw(mod n). 5. Calculate (x1,y1) = u1G + u2QA. 6. The signature is valid if x1 = r(mod n), invalid otherwise.
TODO
With the GMP library installed for Math::BigInt::GMP, this module is fast enough for
many purposes. For others (high volume servers) some of its routines would benefit from
the speed boost of a rewrite in XS, if there is demand for this.
AUTHOR
William Herrera (wherrera@skylightview.com)
COPYRIGHT
Copyright (C) 2007 William Hererra. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 183:
'=item' outside of any '=over'
- Around line 217:
You forgot a '=back' before '=head1'