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

If you used Crypt::CBC,

By the way, your padding method is buggy. It will trim trailing NUL bytes in the data. Crypt::CBC uses a method that allows perfect recovery of the original.

  • Comment on Re^2: Multimedia file encryption : Crypt::CBC or Crypt::Rijndael

Replies are listed 'Best First'.
Re^3: Multimedia file encryption : Crypt::CBC or Crypt::Rijndael
by sundeep (Acolyte) on Nov 16, 2010 at 06:36 UTC
    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..