Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -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"