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 3604558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:00:47+00:00 2026-05-18T21:00:47+00:00

Hi there I am messing around with the Crypt::RSA perl modules. I have gotten

  • 0

Hi there I am messing around with the Crypt::RSA perl modules. I have gotten the modules to encrypt a string (password) and then export it to a file called “test.key” But it occurred to me that the cipher is no good if I cannot get at the key used to encrypt the string in the first place.

When I try to have it simply print the scalar $private and $public, I get a HASH(0x00000) looking output. So as far I can gather that means the key is store in a HASH, the problem is I don’t know the name of the HASH created in order to print the key in question. It says parameters for Crypt::RSA can be found in a man page that apparently does not exist on my system.

Any ideas?

Here is the sample code I have tore apart.

#!/usr/bin/perl

use strict;

use warnings;
use Crypt::RSA;
my $rsa = new Crypt::RSA;
my $message = "hello world";
my ($public, $private) = $rsa->keygen ( 
    #Identity  => '',
    Size      => 1024,  
    #Password  => '', 
    Verbosity => 1,
    ) or die $rsa->errstr();

my $cyphertext = $rsa->encrypt ( 
    Message    => $message,
    Key        => $public,
    Armour     => 1,
    ) or die $rsa->errstr();

my $plaintext = $rsa->decrypt ( 
    Cyphertext => $cyphertext, 
    Key        => $private,
    Armour     => 1,
    ) or die $rsa->errstr();

print $public;

print $private;

open FILE, ">", "test.key" or die $!;
print FILE "$cyphertext\n";
close FILE;
  • 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-05-18T21:00:48+00:00Added an answer on May 18, 2026 at 9:00 pm

    Documentation for modules can be found on CPAN, and should be installed on your system (perldoc Crypt::RSA).

    Here is the relevant link: http://search.cpan.org/dist/Crypt-RSA/

    From there, you want to see the following pages that describe the method based interface to the key variables.

    • Crypt::RSA::Key::Public
    • Crypt::RSA::Key::Private

    For the future, please post the exact output your script produces. In this case, chances are that output contains your answer (the module names of the objects you are trying to print). Then the documentation is just a search away.

    In this case, its probably something like:

    print $_->serialize, "\n" for $public, $private;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just messing around with Rails 3.1, which separates stylesheets via controllers. I'm assuming there
I've recently taken the plunge into DirectX and have been messing around a little
I have been messing around with recursion today. Often a programming technique that is
I have been messing around with GWT uploads lately. I want to have the
There's a .net program for students that I've been messing around with in Reflector
I have been messing around with HtmlUnit for a little bit and particularly this
I'm messing around with QUnit and there is one thing I stumbled upon. I
I've been messing around with the Beta Kinect SDK and was wondering if there
I'm messing around with expression trees, but I'm little stuck. I have this expression:
Hi i am messing around with rails, there is a method built into rails

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.