/etc/shadow (crypt shadow files at least) store 13 chars because the salt that is ues is stored as well as the encrypted password. May I suggest using MD5 digests for the passwords you are storing -- they have two advantages, first they allow long passwords, second crypt has some parts to it that make it easy to brute force (if not completely break it depending on its implementation).
For an example on the /etc/shadow files you may think of it this way:
Get actual cripted password salt from shadow:
$salt = substr($password_string_from_shadow, 0, 2);
$newpass = $salt . crypt($string_i_think_is_password,$salt);
$newpass is now a string you can push back to password file...
-Waswas
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.