The CPAN library contains both pure-Perl and XS (binary) implementations of crypt() functions, although you would have to experiment or check the source-code to see if they follow the 8-character password convention.

Actually, perls builtin crypt uses the crypt(3) the platform provides, on which perl has been compiled. If the platform sports glibc2, then perls builtin crypt supports all crypting flavors the glibc2 crypt(3) provides.

So, to use a better crypt, on a modern system no CPAN modules are necessary, just check the manpage of crypt(3). To wit:

If salt is a character string starting with the characters "$id$" followed by a string terminated by "$":

IDMethod
1MD5
2aBlowfish (not in mainline glibc; added in some Linux distributions)
5SHA-256 (since glibc 2.7)
6SHA-512 (since glibc 2.7)

The DES algorithm taking a 2-char salt and a 8-char password is considered insecure, as are MD5 and SHA1. Don't use them..

The post I am replying to is yet another example of sundialsvc4 providing outdated and therefore possibly harmful information. See man crypt on your system.

sundialsvc4, please update your knowledge every now and then by RTFM. See my sig; and see jackass.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
perl -E '($what = FOOL & MONK)=~s/(.)$/chr((ord$1)+12)/e; say $what'

In reply to Re^2: crypt function has string length limit? by shmem
in thread crypt function has string length limit? by jamroll

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.