How can i run these file in PVM environment?? I'm using the PVM machine but i'm clueless in using these module (Parallel::PVM)

crypto.pl

#!/usr/lib/perl use Time::HiRes qw(gettimeofday); # Get time in microsec and sec pr +ecision use Crypt::Ctr; # Usage of Crypt in Counter Mode print "\nPlease input the key for Counter Mode operation: "; $key = <stdin>; print "Please input the Plaintext for Counter Mode operation: "; $p_text = <stdin>; print "Please input the Ciphertext for Counter Mode operation: "; $c_text = <stdin>; print "Please input the Recovered Plaintext for Counter Mode operation +: "; $r_text = <stdin>; ######################################## # 1. a) Open input file # b) Append to array @plaintext ######################################## open(PLAIN, "$p_text") or die "File does not exist: $!"; binmode PLAIN; while(<PLAIN>){ @plaintext[$element_a] = $_; $element_a++; } close PLAIN; ######################################## # 2. a) Start Encryption Process # b) Get start time (encryption) # c) Print Encrypting ######################################## my ($s_a, $usec_a) = gettimeofday; print "\n: : : Encrypting : : :"; ######################################## # 3. a) Create cipher from counter + key # b) Use either block-cipher or hash ######################################## for ($i = 0; $i < @plaintext; $i++){ $cipher[$i] = new Crypt::Ctr $key, 'Digest::MD5'; } ######################################## # 4. a) Encrypt plaintext -> ciphertext # b) Use XOr embedded Crypt::Ctr ######################################## for ($i = 0; $i < @plaintext; $i++){ $ciphertext[$i] = $cipher[$i]->encrypt($plaintext[$i]); } ######################################## # 5. a) Get stopped time (encryption) # b) Get interval ($time_a - time_b) # c) Print Finished Encrypting ######################################## my ($s_b, $usec_b) = gettimeofday; my $usec_c = $usec_b - $usec_a; my $s_c = $s_b - $s_a; my $time_a = ($s_c*1000000) + $usec_c; print "\n: : : Encryption Finished : : :"; ######################################## # 6. a) Open cipher file # b) Append from array @ciphertext ######################################## open(CIPHERTEXT, ">$c_text"); binmode CIPHERTEXT; foreach $e (@ciphertext){ print CIPHERTEXT $e; } close CIPHERTEXT; ######################################## # 7. a) Start Decryption Process # b) Get start time (decryption) # c) Print Decrypting ######################################## my ($s_d, $usec_d) = gettimeofday; print "\n: : : Decrypting : : :"; ######################################## # 8. a) Reset cipher # b) Decrypt ciphertext -> plaintext # c) Use XOr embedded Crypt::Ctr ######################################## for ($i = 0; $i < @ciphertext; $i++){ $cipher[$i]->reset; $recovertext[$i] = $cipher[$i]->decrypt($ciphertext[$i]); } ######################################## # 9. a) Get stopped time (decryption) # b) Get interval ($time_a - time_b) # c) Print Finished Decrypting ######################################## my ($s_e, $usec_e) = gettimeofday; my $usec_f = $usec_e - $usec_d; my $s_f = $s_e - $s_d; my $time_b = ($s_f*1000000) + $usec_f; print "\n: : : Decryption Finished : : :\n"; ######################################## # 10. a) Open recovered file # b) Append from array @recovertext ######################################## open(RECOVER, ">$r_text"); binmode RECOVER; foreach $e (@recovertext){ print RECOVER $e; } close RECOVER; ######################################## # 11. a) Show input-cipher-ctext-ptext # b) Show time encrypt-decrypt ######################################## #print "\nInput: \n@plaintext\n"; #print "\nCipher: \n@cipher"; #print "\nCiphertext: \n@ciphertext\n"; #print "\nRecovertext: \n@recovertext\n"; print "\n:::Encryption:::"; print "\nTime started: $s_a $usec_a"; print "\nTime finished: $s_b $usec_b"; print "\nTime elapsed: $time_a microsec\n"; print "\n:::Decryption:::"; print "\nTime started: $s_d $usec_d"; print "\nTime finished: $s_e $usec_e"; print "\nTime elapsed: $time_b microsec\n";
I'm using the PVM machine right now, but I dont know how to invoke the parallel command..

Thanx in advance

2005-02-26 Janitored by Arunbear - added readmore tags, as per Monastery guidelines


In reply to Parallel::PVM usage help by cik_ail

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.