Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Crypt::EC_DSA;
|
||||
|
||||
my $ecdsa = Crypt::EC_DSA->new;
|
||||
|
||||
my ($pubkey, $prikey) = $ecdsa->keygen;
|
||||
|
||||
print "Message: ", my $msg = 'Rosetta Code', "\n";
|
||||
|
||||
print "Private Key :\n$prikey \n";
|
||||
print "Public key :\n", $pubkey->x, "\n", $pubkey->y, "\n";
|
||||
|
||||
my $signature = $ecdsa->sign( Message => $msg, Key => $prikey );
|
||||
print "Signature :\n";
|
||||
for (sort keys %$signature) { print "$_ => $signature->{$_}\n"; }
|
||||
|
||||
$ecdsa->verify( Message => $msg, Key => $pubkey, Signature => $signature ) and
|
||||
print "Signature verified.\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue