Hi Kedar, Arun,

On my system my script produces passwords indistinguishable from those 
in /etc/shadow, upto the $1$<salt>$.  Please let me have some output
from the same password in /etc/shadow and fed to my script so that I
can check what the problem is.

BTW, when you run this script in interactive mode (as it is shipped),
it presumes that you're trying to check if the clear-text which the
user has entered is the same as the user's password in /etc/shadow.
In order to do this it needs the salt from the original password.
Hence if you want to check passwords, please enter the original
encrypted password from /etc/shadow at the second (password: )
prompt.

To summarise, if you want to encrypt a fresh password, just call the
sub md5_password with a SINGLE argument -- the clear text to be
encrypted.  If you want to check a clear text against an existing
password, call md5_password with TWO arguments -- the clear text to be 
checked, and the existing password (presumably from /etc/shadow).

Calling a simple md5sum on a clear-text will not give you anything
even remotely resembling /etc/shadow passwords.

HTH

Regards,

-- Raju

>>>>> "Arun" == Arun Sharma <[EMAIL PROTECTED]> writes:

    Arun> On Wed, Jun 07, 2000 at 07:19:23PM +0530, Kedar Patankar
    Arun> wrote:
    >> And to top it all, the three outputs: viz. /etc/shadow, md5sum
    >> and this perl script, ***don't*** match eachother... What the
    >> hell is happening here? I guess I have to ask this on openldap
    >> mailing lists...

    Arun> md5sum = pure md5 algorithm /etc/shadow - appends a special
    Arun> prefix ($1$) to distinguish from a DES encrypted password
    Arun> Your script = md5 + base64 encoding

    Arun>       -Arun

-----------------------------------------------------------------------
Check out the 'What to do before posting to the list' site
for a list of things to try before posting.  The site is
at http://botsie.tripod.com/beforeposting/

Reply via email to