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

  • SEARCH
  • Home
  • 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 6096979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:59:24+00:00 2026-05-23T12:59:24+00:00

I have some ciphertext that has been encrypted using Perl’s Crypt::CBC module that I

  • 0

I have some ciphertext that has been encrypted using Perl’s Crypt::CBC module that I wish to decrypt elsewhere.

The ciphertext was generated using the ‘simple’ version of the Crypt::CBC constructor, that is:

use Crypt::CBC;
$cipher = Crypt::CBC->new( -key    => 'my secret key',
                           -cipher => 'Blowfish'
                          );

From reading the MAN page, this method of construction will take the simple string key and random salt to generate an IV & literal key to use for encryption, as well as embed a header with the salt.

“salt” — Combine the passphrase with
an 8-byte random value to
generate both the block cipher key and the IV from the
provided passphrase. The salt will be appended to the
beginning of the data stream allowing decryption to
regenerate both the key and IV given the correct passphrase.
This method is compatible with current versions of OpenSSL.

I now need to decrypt the ciphertext on another platform that only supports CBC decryption given the ciphertext, a literal key & IV. To attempt to generate the literal key, IV & salt, I used Crypt::CBC to generate the values like so:

my $crypt = new Crypt::CBC(-key => 'my secret key', -cipher => 'Blowfish');
my $out = $crypt->decrypt($ciphertext);
my $literal_key = $crypt->key();
my $iv = $crypt->iv();
my $salt = $crypt->salt();

The decryption here is correct, but I’ve been unable to use the generated literal key & IV to decrypt the cipher; this produces rubbish:

my $crypt2 = new Crypt::CBC(
    -literal_key => 1,
    -key => $literal_key,
    -cipher => 'Blowfish',
    -iv => $iv,
    -header => 'none');
my $rubbish - $crypt2->decrypt($ciphertext);

I can’t provide a literal key and use a salted header so I’m lost as to the next move.

How can I decrypt this text?

EDIT: The target system is not running Perl, but I have been able to generate the identical value as in $rubbish above, so I’m sure it’s using the same algorithm (CBC, Blowfish) to decipher.

  • 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-23T12:59:25+00:00Added an answer on May 23, 2026 at 12:59 pm

    To decrypt the stream, you first need to remove the header added by Crypt::CBC’s “salt” mode. The header consists of the 8 characters Salted__ followed by 8 bytes of salt data.

    In perl, something like this should do it:

    my $crypt2 = new Crypt::CBC(
        -literal_key => 1,
        -key => $literal_key,
        -cipher => 'Blowfish',
        -iv => $iv,
        -header => 'none');
    my $cleartext = $crypt2->decrypt(substr($ciphertext, 16));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some encryption code that has been written in Perl (also a code
I have a ciphertext, encrypted in 3DES CBC mode, and I'm having some trouble
Have some Perl code which is using the DBI module - (the code is
I have some automatic de-serialization code that will set an object's properties using KVC
I have some encrypted data that I'm converting to a base64. I am having
Have some JavaScript that assigns values to an object using $.data and then uses
I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
I have some C# / asp.net code I inherited which has a textbox which
We have some files on our website that users of our software can download.

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.