ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Crypt-Ed25519/README
(Generate patch)

Comparing Crypt-Ed25519/README (file contents):
Revision 1.6 by root, Tue Feb 28 19:53:08 2017 UTC vs.
Revision 1.7 by root, Wed Aug 11 23:02:08 2021 UTC

35 # verify message 35 # verify message
36 $valid = Crypt::Ed25519::eddsa_verify $message, $pubkey, $signature; 36 $valid = Crypt::Ed25519::eddsa_verify $message, $pubkey, $signature;
37 37
38 # verify, but croak on failure 38 # verify, but croak on failure
39 Crypt::Ed25519:eddsa_verify_croak $message, $pubkey, $signature; 39 Crypt::Ed25519:eddsa_verify_croak $message, $pubkey, $signature;
40
41 ############################################
42 # Key exchange
43
44 # side A:
45 ($pubkey_a, $privkey_a) = Crypt::Ed25519::generate_keypair;
46 # send $pubkey to side B
47
48 # side B:
49 ($pubkey_b, $privkey_b) = Crypt::Ed25519::generate_keypair;
50 # send $pubkey to side A
51
52 # side A then calculates their shared secret:
53 $shared_secret = Crypt::Ed25519::key_exchange $pubkey_b, $privkey_a;
54
55 # and side B does this:
56 $shared_secret = Crypt::Ed25519::key_exchange $pubkey_a, $privkey_b;
57
58 # the generated $shared_secret will be the same - you cna now
59 # hash it with hkdf or something else to generate symmetric private keys
40 60
41DESCRIPTION 61DESCRIPTION
42 This module implements Ed25519 public key generation, message signing 62 This module implements Ed25519 public key generation, message signing
43 and verification. It is a pretty bare-bones implementation that 63 and verification. It is a pretty bare-bones implementation that
44 implements the standard Ed25519 variant with SHA512 hash, as well as a 64 implements the standard Ed25519 variant with SHA512 hash, as well as a
156 derive the public key as needed. On the other hand, signing using the 176 derive the public key as needed. On the other hand, signing using the
157 private key is faster than using the secret key, so converting the 177 private key is faster than using the secret key, so converting the
158 secret key to a public/private key pair allows you to sign a small 178 secret key to a public/private key pair allows you to sign a small
159 message, or many messages, faster. 179 message, or many messages, faster.
160 180
181Key Exchange
182 As an extension to Ed25519, this module implements a key exchange
183 similar (But not identical) to Curve25519. For this, both sides generate
184 a keypair and send their public key to the other side. Then both sides
185 can generate the same shared secret using this function:
186
187 $shared_secret = Crypt::Ed25519::key_exchange $other_public_key,
188 $own_private_key
189 Return the 32 octet shared secret generated from the given public
190 and private key. See SYNOPSIS for an actual example.
191
161SUPPORT FOR THE PERL MULTICORE SPECIFICATION 192SUPPORT FOR THE PERL MULTICORE SPECIFICATION
162 This module supports the perl multicore specification 193 This module supports the perl multicore specification
163 (<http://perlmulticore.schmorp.de/>) for key generation (usually the 194 (<http://perlmulticore.schmorp.de/>) for all operations, although it
164 slowest operation), and all signing and verification functions. 195 makes most sense to use it when signing or verifying longer messages.
165 196
166IMPLEMENTATIOIN 197IMPLEMENTATION
167 This module currently uses "Nightcracker's Ed25519" implementation, 198 This module currently uses "Nightcracker's Ed25519" implementation,
168 which is unmodified except for some portability fixes and static 199 which is unmodified except for some portability fixes and static
169 delcarations, but the interface is kept implementation-agnostic to allow 200 delcarations, but the interface is kept implementation-agnostic to allow
170 usage of other implementations in the future. 201 usage of other implementations in the future.
171 202
172AUTHOR 203AUTHOR
173 Marc Lehmann <schmorp@schmorp.de> 204 Marc Lehmann <schmorp@schmorp.de>
174 http://sfotware.schmorp.de/pkg/Crypt-Ed25519.html 205 http://software.schmorp.de/pkg/Crypt-Ed25519.html
175 206

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines