Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Crypt::RSA: RSA encryption/decryption

by btrott (Parson)
on Feb 28, 2001 at 08:07 UTC ( [id://61281]=note: print w/replies, xml ) Need Help??


in reply to Crypt::RSA: RSA encryption/decryption

Oh--by way of usage notes, here's that obfuscated program rewritten to use this module:
#!/usr/bin/perl -w use strict; use Getopt::Std; getopts("d", \my %opts); my $d = $opts{d} || 0; use Crypt::RSA; my($key, $n) = (shift, shift); die "usage: $0 [-d] <k> <n>" unless $key && $n; my $rsa = Crypt::RSA->new($key, $n); my $c = do { local $/; <STDIN> }; if ($opts{d}) { print $rsa->decrypt($c); } else { print $rsa->encrypt($c); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://61281]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-29 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found