I use Perl 5.10 ActivePerl 5.14 on win7. I am a humble user, and don't really understand what I am doing.

I have a requirement to connect to a remote host and send locally encrypted messages, using DES ECB mode encryption. This is not my choice, but a part of the requirement. I am trying to find out how to implement DES ECB mode encryption simply in Perl

I do not have access to a C compiler, and cannot be the local administrator on my machine. I don't have download rights either, but can copy / paste source from CPAN into .pm files in my C:. I have copied the source for DES.pm and ECB.pm to C:\Perl 5.10\lib\Crypt\ from CPAN.

In my script I use

use Crypt::ECB qw(encrypt decrypt encrypt_hex decrypt_hex);

and try using it as a proof of concept - the text is from FIPS PUB 81:

print encrypt_hex("0123456789abcdef", "DES", "Now is the time for all ", "1") . "\n";

However, when trying to run this, I see the following error:

Couldn't load Crypt::DES: Attempt to reload Crypt/DES.pm aborted. Compilation failed in require at (eval 27) line 3. Are you sure 'DES' is correct? If so, install Crypt::DES in the proper + path or choose some other cipher.

I think this is because I don't have a binary for DES (not sure what this means).

I did notice that there is a DES module written in Perl called Crypt::DES_PP. Would using this solve the problem and help me satisfy the requirement? If so, how can I use this module? (Basic, please, I don't understand much!)

Thanks in advance for any assistance!!!


In reply to DES ECB mode encryption by v4169sgr

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.