The Crypt docco says:

Traditionally the result is a string of 13 bytes: two first bytes of the salt, followed by 11 bytes from the set ./0-9A-Za-z, and only the first eight bytes of the encrypted string mattered, but alternative hashing schemes (like MD5), higher level security schemes (like C2), and implementations on non-UNIX platforms may produce different strings.

So I would expect test1234 to crypt to the same as test12345 but not test123. Here is some test code showing just that behaviour:

nph>perl -ne'BEGIN{print "Pass: "}; $S="ab"; print crypt($_, $S), "\nP +ass: "' Pass: test abpNYMT5RGuX6 Pass: test1 abW8wbI6pkG9g Pass: test12 abP627jOqenSg Pass: test123 abpwNzBDeyy9Y Pass: test1234 abP/cckPJaUqA Pass: test12345 abP/cckPJaUqA Pass: test123456 abP/cckPJaUqA Pass:
I used a constant salt just to keep things simple. Are you using Unicode so that 8 bytes is less characters ? I see enyas (sp?) in your code like the one here print $fh "$userñ$pass";

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

In reply to Re: crypt help by Random_Walk
in thread crypt help by dave_pl

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.