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

Re^4: Private keys in Crypt::RSA

by dchoksi (Initiate)
on Jun 26, 2007 at 15:08 UTC ( #623428=note: print w/replies, xml ) Need Help??

in reply to Re^3: Private keys in Crypt::RSA
in thread Private keys in Crypt::RSA

Hi, I am trying to use deserialize i get an error every time "n is not a number". I have generated a set of keys and dont want to store private key any where. Currently as I am testing my code I have stored the serialize key as variable. It does not error when i pass it to $private->deserialize but errors when I call $rsa->decrypt. Can you please help me. thanks

Replies are listed 'Best First'.
Re^5: Private keys in Crypt::RSA
by headcode (Initiate) on Oct 15, 2013 at 22:46 UTC

    I realize this is an ancient thread, but I ran across the same error and finally figured out the problem.

    After de-serializing the private key (I just used the Crypt::RSA::Key::Private->read method) you MUST use the 'reveal' method and give it the password you originally used to generate the keypair.

    my $rsa_private = new Crypt::RSA::Key::Private; my $private = $rsa_private->read(Filename => "id_rsa"); ## This is vital if you want the loaded private key to work. $private->reveal(Password => "originalkeypairpassword");

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623428]
[LanX]: yep, sorry ;(
[Eily]: such a fine and clever workaround though...
[LanX]: well even my random fingers have memory ...
[Eily]: you could have tried randomly swapping your fingers
[Eily]: enigma style
[choroba]: so it was you who typed the whole phrases?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2017-03-28 13:04 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (331 votes). Check out past polls.