From Wikipedia

SHA-1 is no longer considered secure against well-funded opponents. In 2005, cryptanalysts found attacks on SHA-1 suggesting that the algorithm might not be secure enough for ongoing use,, and since 2010 many organizations have recommended its replacement by SHA-2 or SHA-3

Sure, it's still more secure than crypt (edit: at least the version of crypt discussed in the OP), but your very long paragraph makes it sound like it's some sort of perfect magical solution. Salting isn't specific to SHA, actually you can just add your salt at the end of your input data and call it salting as long the algorithm accepts arbitrary length. And SHA-1 is "thought" to be more-secure than MD5: well MD5 outputs 128 bits of data, against 160 for SHA-1. I'd say it's around 32 bits more secure .

Edit: oh and you may get an unlimited number of password/salt combinations. But no matter how often you change the salt, you won't get more than 2^160 different output values.

Edit: The wikipedia page for SHA-1 actually has a comparison of hash functions which gives one less bit of information for SHA-1 than MD5. So I remove my claim about the 32 bits additional security. And this directly contradicts your claim that "SHA1 is thought to be a more-secure algorithm than MD5".


In reply to Re^2: crypt function has string length limit? by Eily
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.