CBC/BLOWFISH, NEWBIE HELP - CAN'T DECRYPT FROM SAVED FILE

H

Homer J.

Hello,

I'm wondering if the experienced PERL people can help me here.

I'm stuck. I'm trying to use Crypt::CBC using Blowfish to encrypt
some data. I can get it to encrypt and decrypt OK as long as I assign
the ciphertext to a variable and decrpyt it from that variable all
within the same script execution. However, when I save the ciphertext
to a text file and then subsequently open the file and read in the
ciphertext to a variable and finally try to decrypt the cipheredtext I
get garbage instead of my original test message.

Someone please help! I'm sure it's, something obviously wrong that
I've done, but I can't seem to figure out what it is.

Homer
(e-mail address removed)
 
G

Greg Schmidt

I'm stuck. I'm trying to use Crypt::CBC using Blowfish to encrypt
some data. I can get it to encrypt and decrypt OK as long as I assign
the ciphertext to a variable and decrpyt it from that variable all
within the same script execution. However, when I save the ciphertext
to a text file and then subsequently open the file and read in the
ciphertext to a variable and finally try to decrypt the cipheredtext I
get garbage instead of my original test message.

Someone please help! I'm sure it's, something obviously wrong that
I've done, but I can't seem to figure out what it is.

Are you writing and reading the file in binary mode? Text mode may do odd
things to binary data such as cipertext.
 
H

Homer J.

Greg Schmidt said:
Are you writing and reading the file in binary mode? Text mode may do odd
things to binary data such as cipertext.

Hi Thanks for your replies. Yes I think that did it! Thank you.

Homer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top