Using rsaconverter it is easy to recover the primes and afterwards construct the rsa private key:

#!/usr/bin/perl use strict; use warnings; use Crypt::OpenSSL::Bignum; use Crypt::OpenSSL::RSA; my $pub = '51BCDA086D39FCE4565160D651713FA2E8AA54FA6682B04AABDD0E6AF8B +0C1E6D1FB4F3DAA437F15'; my $priv = '0A5637BC99139C47C422C67C54105E5BDBD0AEAE4AB4D4334358274E1B +DF5706A1FBF4E682893081'; my $expo = '10001'; my $prime1 = '0145D2582F15952704BA91878C88E486464D67753F'; my $prime2 = '4038C78C871A1B9790BBCD713C28DBAB84E652AB'; my $n = Crypt::OpenSSL::Bignum->new_from_hex($pub); my $e = Crypt::OpenSSL::Bignum->new_from_hex($expo); my $d = Crypt::OpenSSL::Bignum->new_from_hex($priv); my $p = Crypt::OpenSSL::Bignum->new_from_hex($prime1); my $q = Crypt::OpenSSL::Bignum->new_from_hex($prime2); my $rsa = Crypt::OpenSSL::RSA->new_key_from_parameters($n, $e, $d, $p, + $q); die "invalid key" unless $rsa->check_key;

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

In reply to Re: Importing keys into Crypt::Openssl::RSA by jo37
in thread Importing keys into Crypt::Openssl::RSA by BOfH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.