GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Crypt::Perl::RSA(3) User Contributed Perl Documentation Crypt::Perl::RSA(3)

Crypt::Perl::RSA - RSA in pure Perl (really!)

    my $prkey1 = Crypt::Perl::RSA::Parse::private($pem_or_der);
    my $pbkey1 = Crypt::Perl::RSA::Parse::public($pem_or_der);

    #----------------------------------------------------------------------

    my $prkey = Crypt::Perl::RSA::Generate::generate(2048);

    my $der = $prkey->to_der();
    my $der2 = $prkey->to_pem();

    #----------------------------------------------------------------------

    my $msg = 'My message';

    my $sig = $prkey->sign_RS256($msg);

    die 'Wut' if !$prkey->verify_RS256($msg, $sig);

    die 'Wut' if !$pbkey->verify_RS256($msg, $sig);

See the documentation for Crypt::Perl::RSA::PublicKey and Crypt::Perl::RSA::PrivateKey for more on what these interfaces can do.

NOTE: The RSA logic here is ported from Kenji Urushima’s jsrsasign <http://kjur.github.io/jsrsasign/>.

RSA is safe as long as factorization is “hard”. As computers get faster, RSA keys have needed to get bigger and bigger to maintain the “difficulty” of factoring the key’s modulus. RSA will eventually no longer be viable toward this end: as RSA keys get bigger, the security advantage of increasing their size diminishes.

Key generation is probably generally useful only with an XS-based backend to Math::BigInt. Once Math::Prime::Util is installable without a compiler I’ll replace Math::ProvablePrime here with Math::Prime::Util, which should speed things up significantly.

This minimal set of functionality can be augmented as feature requests come in. Ideas:
  • Support signature schemes besides PKCS #1 v1.5.
  • Use faster prime-number-finder logic if it’s available.
2016-12-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.