Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Crypt::CBC help!

by BMaximus (Chaplain)
on Mar 13, 2002 at 00:19 UTC ( [id://151274]=note: print w/replies, xml ) Need Help??


in reply to Crypt::CBC help!

I don't see $cipher->finish anywhere. Read the Crypt::CBC man page. $cipher->finish must be called after the last $cipher->crypt() to flush the buffer out. That's why the last line isn't making it to the file.

Update:I think I need to elaborate.

if ($mode == 0) { open(INFILE, "<$inFile") || die "Error opening source file for inp +ut! \n"; open(CRYPTFILE, ">$cryptFile") || die "Error opening crypt file fo +r output! \n"; $cipher->start('encrypting'); while (<INFILE>) { print CRYPTFILE $cipher->crypt($_); } print CRYPTFILE $cipher->finish; close INFILE; close CRYPTFILE;

BMaximus

Replies are listed 'Best First'.
Re: Re: Crypt::CBC help!
by Anonymous Monk on Mar 13, 2002 at 15:40 UTC
    Duh! I really was clumsy there. Didn't read the documentation all the way through. Thanks for your input ...it worked.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://151274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-19 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found