Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:28:56+00:00 2026-06-11T19:28:56+00:00

I have simple RSA encoding/decoding script, such as: use Crypt::RSA; my $rsa = new

  • 0

I have simple RSA encoding/decoding script, such as:

use Crypt::RSA;

my $rsa = new Crypt::RSA;
my($public, $private) = $rsa->keygen( Size => 2048 )
                        or die $rsa->errstr();

my $email = '...';

my $em = $rsa->encrypt( Message => $email, Key => $public  );
my $dm = $rsa->decrypt( Ciphertext => $em, Key => $private );

print "$dm\n";

However I want to modify this script to use RSA keys as e, d and n values, such as:

e => 10001
d => 135b03530e94874283f0f0000ffff0001
n => 24000c6c9620886831124848640044901

How can I convert these three parameters into Crypt::RSA::Key objects and vice versa?

Or, how can I use these three parameters with Crypt::RSA for encryption and decryption?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:28:58+00:00Added an answer on June 11, 2026 at 7:28 pm

    I advice you check this module: Crypt::OpenSSL::RSA, Crypt::OpenSSL::Bignum, or check how I use it one of my repository in github: Perl backend for Jcryption

    Create RSA by parameters n,e,d

    use strict;
    
    use Crypt::OpenSSL::Bignum;
    use Crypt::OpenSSL::Random;
    use Crypt::OpenSSL::RSA;
    
    my $param_ref = {
        n => 'C8F19E3A7C18A5FE6D1DE07926F4E6403EA6558EE4892D29155F2C52678E210FE5D61DBC9EC77F2DD39FC8D9F2717F23629B7E18BDB38AADF9FC5BF1CA968C67F4BF0F2D6657E1374A845048B6CDCB2B8B2B3F31BF7F134A11B9A063EB7C326B27C0027955637E6089293F5F4CD40F5B91142BBA61B8E473A8D14B447896B5FD',
        e => '010001',
        d => '574C612997703DED630A6FD3329182D6B6611D1A8F3EE957C7E9292043CD03A01C82013948E1F2E6BDE1D5289AA3A450832E7A81D528833F4233D8DE1ADD7CF1878CBACDE64DE4364F8B73093753D6E322732EAEC942281CE4AF55D212E77EC4A108708864D3F86A67C63FBE8206A543A42ABF45E56C1E41A2F2BA0CCC1C8001',
    };
    
    my $n = Crypt::OpenSSL::Bignum->new_from_hex($param_ref->{n});
    my $e = Crypt::OpenSSL::Bignum->new_from_hex($param_ref->{e});
    my $d = Crypt::OpenSSL::Bignum->new_from_hex($param_ref->{d});
    
    my $rsa = Crypt::OpenSSL::RSA->new_key_from_parameters($n, $e, $d);
    
    printf "private key is: %s\n", $rsa->get_private_key_string();
    printf "public key (in PKCS1 format) is: %s\n", $rsa->get_public_key_string();
    

    Get key parameters from RSA object

    use strict;
    
    use Crypt::OpenSSL::Bignum;
    use Crypt::OpenSSL::Random;
    use Crypt::OpenSSL::RSA;
    
    my $rsa = Crypt::OpenSSL::RSA->generate_key(2048);
    my ($n, $e, $d, $p, $q) = $rsa->get_key_parameters();
    
    printf "private key is: %s\n", $rsa->get_private_key_string();
    printf "public key (in PKCS1 format) is: %s\n", $rsa->get_public_key_string();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that I have to sign with RSA private key
Hi there I am messing around with the Crypt::RSA perl modules. I have gotten
...working on a primitive RSA (public/private key) based copy protection mechanism for our software.
I have a PKCS#5 encrypted PKCS#8 RSA private key stored in a disk file
I have simple method in C# : public static string BetweenOf(string ActualStr, string StrFirst,
I am new to Rails, and I was trying to deploy a very simple
I have simple code: <?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('html_errors', false); $test = array(); $test
I have simple jQuery Mobile site created using asp.net mvc 2 and uses basic
I searched a lot online but stuck with doubts in RSA public key and
I have a simple thing to do : I want to encryt data using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.