tame1 has asked for the wisdom of the Perl Monks concerning the following question:
The killer is that bitsize ($key->n). I have turned on Armour (Armour => 1) and base64 encoded the key I am sending, but still the system is unable to call method n on they $key value.sub decrypt { my ($self, %params) = @_; my $key = $params{Key}; my $cyphertext = $params{Cyphertext}; $cyphertext = unpack "u*", $cyphertext if $params{Armour}; my $plaintext; my $blocksize = ((bitsize ($key->n)) / 8); my @segments = steak ($cyphertext, $blocksize); for (@segments) { $plaintext .= $self->{eme}->decrypt (Cyphertext=> $_, Key => $ +key) || return $self->error ($self->{eme}->errstr, \$key, \%par +ams); } return $plaintext; }
No matter what I feed in as $public_key, in whatever form, RSA.pm always says it can't call method n on it.# $decoded is the base64 decoded cookie my @fields = get_fields($decoded); my $public_key = get_pubkey($fields[2]); # Verified to work my $rsa = new Crypt::RSA; my $checksum = $rsa->decrypt( Cyphertext => $encrypted, Key => $public_key, Armour => 1,) || die $rsa->errstr();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Crypt fun
by btrott (Parson) on Mar 27, 2001 at 02:26 UTC | |
by tame1 (Pilgrim) on Mar 27, 2001 at 20:10 UTC | |
by btrott (Parson) on Mar 27, 2001 at 22:09 UTC | |
|
Re: Crypt fun
by baku (Scribe) on Mar 27, 2001 at 00:25 UTC | |
|
(tye)Re: Crypt fun
by tye (Sage) on Mar 27, 2001 at 01:24 UTC | |
|
Re: Crypt fun
by archon (Monk) on Mar 27, 2001 at 00:10 UTC | |
by tame1 (Pilgrim) on Mar 27, 2001 at 00:23 UTC |