I was using Crypt::CBC successfully for a long time, then when the server apache was upgraded all of a sudden I get this error:

Ciphertext does not begin with a valid header for 'salt' header mode

Here is my encryption and decryption subroutine:
sub encrypt { my $plaintext = shift; my $key = "lkjsdfkjkalsjdfn239asdifh4389jbaksdf 09324ni5ansdkfn2193rjlkasndfkn239jas dknsd23r09jasdflknasdi823oiasdflknas dlkn3249ijasdfknoi2oinklnsd9u345knfv knnalknq234ij9rnadks0934klajlkjdsnkl ansdkjsdimnvnkansdkj43938hiohsakasoi jwenkasdlknaskdiojiqwejoinasdlknqweo inasdlknf9034pojfjasdflknvlknasflkjn asddasflknewfqo9ijwernasdlknasdflkj2 eijasdlnasdknvkxlcvnaslkjqwerknzxvcm nweoiuwr098u345oijsfdlkn241389asdfr0 9u34oijasdfklnvsdoi32098u34oisdfklas fdklnasdk934nzslzWQPLIWNCZAEI30SN20S"; my $cipher = Crypt::CBC->new( -key => $key, -cipher => 'Blowfish', -salt => 1 ); return ($cipher->encrypt_hex ($plaintext)); } sub decrypt { my $ciphertext = shift; my $key = "lkjsdfkjkalsjdfn239asdifh4389jbaksdf 09324ni5ansdkfn2193rjlkasndfkn239jas dknsd23r09jasdflknasdi823oiasdflknas dlkn3249ijasdfknoi2oinklnsd9u345knfv knnalknq234ij9rnadks0934klajlkjdsnkl ansdkjsdimnvnkansdkj43938hiohsakasoi jwenkasdlknaskdiojiqwejoinasdlknqweo inasdlknf9034pojfjasdflknvlknasflkjn asddasflknewfqo9ijwernasdlknasdflkj2 eijasdlnasdknvkxlcvnaslkjqwerknzxvcm nweoiuwr098u345oijsfdlkn241389asdfr0 9u34oijasdfklnvsdoi32098u34oisdfklas fdklnasdk934nzslzWQPLIWNCZAEI30SN20S"; my $cipher = Crypt::CBC->new( -key => $key, -cipher => 'Blowfish', -salt => 1 ); return ($cipher->decrypt_hex ($ciphertext)); }
Of course I changed the key to a test one, but that is not the problem, my key did not change at all... in fact nothing at all changed... only the server was upgraded...

My question is this, is there a way to recover from this? There is a lot of information encrypted in my database, passwords of members and so forth, so I need to recover this instead of just having to start over. I have used this method for at least 4 years, maybe 3 but seems like 4 or 5.

Thank you much,
Richard

In reply to Crypt::CBC, Blowfish and Salt problem by Anonymous Monk

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.