But if I create the keys and use them directly (no writing to and reading from file) it all works fine.
Maybe this is interesting: If I print the key before writing I get the following:
key=Password valu=A day so foul & fair key=Version valu=1.91 key=Checked valu=0 key=Identity valu=Lord Macbeth <macbeth@glamis.com> ..... key=_phi=> 7210735926686440535829990956186709974464809186521836 +355832311976096790529618024634910931659740003773771843595827999358462 +719066220022694321619622387401960 ..... key=_n=> 721073592668644053582999095618670997446480918652183635 +583231197609679052961819700359005877557710889766589552041195848079762 +1578108309291796942263931673339 ..... key=_q=> 100915410784627151408499821928866674137454562910056455 +419204814119795206900509 ..... key=_u=> 714532683424886856966240721230579098216677719924554328 +67392661202846337370871 ..... key=_dp=> 55244914096508209456284400117059592742268460981246650 +212332286378244672760967 ..... key=_dq=> 36302843828674577225696808359880055897158426599215535 +471345551979357835961943 ..... key=_d=> 880471060418539224794851735339212418508575599615030917 +0194136550910004929385 ..... key=_e=> 641184135470923308460913000233054168594704091053521728 +905021305093331347031478407043455534130351495979870847598261273194948 +5272487877726082773168046267553 ..... key=_p=> 65537 key=Cipher valu=Blowfish
If I print the code after writing it to file (so I haven't red it yet!):
key=Version valu=1.91 key=Checked valu=0 key=Identity valu=Lord Macbeth <macbeth@glamis.com> key=private_encrypted valu=Tie::EncryptedHash=HASH(0x8451cb0) key=Cipher valu=Blowfish


Luca

In reply to Re^2: Crypt::RSA problem by jeanluca
in thread Crypt::RSA problem by jeanluca

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.