Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Multimedia file encryption : Crypt::CBC or Crypt::Rijndael

by sundeep (Acolyte)
on Nov 16, 2010 at 06:36 UTC ( [id://871647]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Multimedia file encryption : Crypt::CBC or Crypt::Rijndael
in thread Multimedia file encryption : Crypt::CBC or Crypt::Rijndael

Dear Monks,

I completely changed my script , using some examples mentioned used in Crypt::CBC

I believe, this code is working fine for me. But, just wanted to get the confirmation from you guys.

my $start=time(); use Crypt::CBC; use strict vars; use strict; use warnings; my $key="abcdefgghjkloiuy"; my $cipher = Crypt::CBC->new(-key => $key, -cipher => 'Rijndael', -salt => 1, ) || die "Couldn't create CBC object"; open(F,"Robo.mp4"); $cipher->start('encrypting'); while (read(F,my $buffer,1024)) { $cipher->crypt($buffer); } $cipher->finish; my $end=time(); print "\n".$end-$start;

IF the code is completely correct, can someone suggest a better way to calculate the time for execution, which also shows the milliseconds too..

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-26 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found