Apache crypt to SHA or standard Unix crypt

Leah Cunningham leah-8JrgHtYBq2OWVfeAwA7xHQ at public.gmane.org
Tue Oct 25 16:44:40 UTC 2005


On Thu, 2005-10-13 at 04:31 -0400, Behdad Esfahbod wrote:
> On Wed, 12 Oct 2005, Leah Cunningham wrote:
> > Any clue where I would start?  Doing a crypt like this works fine for
> > LDAP in perl:
> >
> >  my($cpass) = crypt "$pass",(join '', ('.', '/', 0..9,
> > 'A'..'Z','a'..'z')[rand 64, rand 64]);
>
> Can you give us examples maybe?   From my experiments, the crypt
> is the same:

As a follow-up, you are correct, the crypt is the same.  I just figured
out that I was getting trailing carriage returns on the password file
that I was reading in that I was failing to chomp, so it was actually a
problem with my script.  

> but the MD5 format is different:
> 
> [behdad at home ~]$ htpasswd -c -m -b htpasswd behdad testPass
> Adding password for user behdad
> [behdad at home ~]$ cat htpasswd
> behdad:$apr1$uP4iP...$05P2T5MH8yXH7qJEQwezV.

-- 
Leah Cunningham : d416-585-9971x692 : d416-703-5977 : m416-559-6511
Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list