Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to decrypt Blowfish-encrypted text encrypted with Perl's Crypt::CBC?
#1
I've been a Perl writer for 20 years, and I'm just getting started with Python. I have a text file with some fields that were encrypted using Perl's Crypt::CBC and stored as hex. Here's how I currently decrypt it in Perl:

Output:
use Crypt::CBC; my $text = <encrypted hex string>; my $cipher_type = 'Blowfish'; my $encrypt_key = <my 64 byte key>; my $cipher = Crypt::CBC->new(-key => $encrypt_key, -cipher => $cipher_type); my $decoded_text = $cipher->decrypt_hex($text);
No salt was specified during the encryption. I want to be able to decrypt the hex string from within a Python script. Converting from hex to a string is straightforward enough, but apparently Blowfish is restricted to <= 56-byte keys, which leaves me really confused (I'm unclear as to how the Perl Blowfish decryption is using those 64 bytes, and how to do the same in Python). Help!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How best to format text in a simple text file? Pedroski55 2 430 Jun-14-2019, 06:07 AM
Last Post: noisefloor
  Need help understanding a couple of functions (encrypt,decrypt, int_to_bytes) xoani 0 119 Jun-09-2019, 03:25 PM
Last Post: xoani
  Simple inter-process communication: Switching from Perl to Python Pappy 1 200 May-10-2019, 12:29 AM
Last Post: Pappy
  write each line of a text file into separate text files and save with different names Shameendra 3 300 Feb-20-2019, 09:07 AM
Last Post: buran
  How do i read particular text from text file and update those values in MS SQL table ganeshsai2912 33 2,565 Nov-20-2018, 12:55 AM
Last Post: ganeshsai2912
  Anyone knows how to decrypt a gif file? SoulsKeeper 0 468 Aug-29-2018, 10:25 AM
Last Post: SoulsKeeper
  How to write a code to open and read text file by clicking on the "text file" kavindu 4 856 Jul-06-2018, 06:55 PM
Last Post: buran
  how to enter text in text box inside a program? Astronometria 0 606 Mar-10-2018, 11:54 PM
Last Post: Astronometria
  Decrypt Caesar Cipher WantToImprove 22 4,698 Jan-30-2018, 08:43 AM
Last Post: WantToImprove

Forum Jump:


Users browsing this thread: 1 Guest(s)