1. You don't need a loop to do character matching, and
  2. You don't need to call an external program to get the current date.

Try something like this:

#!/perl/bin/perl use warnings; use strict; use Crypt::RC4; my $foo1 = pack 'H*', 'C5C444220AD6FB08972792318300CC703814513EE013AF9 +7B94FF9ACF23F9C8F0E748C04B2E18BB5A1B491BB73E23EC9A4233B9BCDE4854FD03D +CBAC4B3E9EA00F5BF7A3A119B0FF2E66C9DD96E7F4F0972959082601AA5DD202DFB05 +039CA4FDC280517E244353690C0DE1A'; my $dt = localtime; print "$dt Start\n"; my $key = 'A'; my $ct; while ( 1 ) { my $ucrypt = RC4( $key, $foo1 ); if ( ++$ct == 10_000 ) { $dt = localtime; print "$dt count $ct key: $key\n"; $ct = 0; } if ( $ucrypt !~ /[\x80-\xFF]/ ) { print "matched using key:$key\n$ucrypt\n"; } $key++; }

In reply to Re: RC4 cipher performance by jwkrahn
in thread RC4 cipher performance by jaiello

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.