Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 08:50:51 +0800
From:      "Daniel Marsh" <daniel@stiw.org>
To:        "Gareth Bailey" <gjbailey@gmail.com>, freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Creating standalone passwords in /etc/passwd format
Message-ID:  <op.svmna1najjurwa@dyn94.dcjarmichael.com.au>
In-Reply-To: <48a5f32a0508160307c2a555e@mail.gmail.com>
References:  <48a5f32a050815072936dbdf99@mail.gmail.com> <48a5f32a0508160307c2a555e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Aug 2005 18:07:06 +0800, Gareth Bailey <gjbailey@gmail.com>  
wrote:

> I have had a look at crypt (enigma), but it doesn't appear to use the
> same algorithm? I need the same as that used in passwd!
>
> Thanks

Try making a PERL script with the following lines...

$UserDetails{EncryptedPassword} = crypt($UserDetails{TextPassword}, join  
'', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]); # this  
creates an encrypted password the same format as the MD5 in /etc/passwd

my $PassMD5 = crypt($Login->{Password}, $EncryptedPassword); # this  
creates the same MD5 string, used for verification of entering passwords  
encrypted with the above method.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.svmna1najjurwa>