Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C6E7D87A for ; Thu, 21 Jun 2012 03:43:08 +0000 (UTC) Received: (qmail 42308 invoked by uid 500); 21 Jun 2012 03:43:07 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41991 invoked by uid 500); 21 Jun 2012 03:43:04 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 41960 invoked by uid 99); 21 Jun 2012 03:43:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 03:43:03 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=HTML_IMAGE_ONLY_28,HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of noel.butler@ausics.net designates 27.33.160.23 as permitted sender) Received: from [27.33.160.23] (HELO valhalla.ausics.net) (27.33.160.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 03:42:55 +0000 Received: from [10.10.0.145] (tardis.ausics.net [10.10.0.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by valhalla.ausics.net (Postfix) with ESMTPSA id 80FE1C0E11B for ; Thu, 21 Jun 2012 13:42:32 +1000 (EST) Subject: Re: md5crypt passwords From: Noel Butler To: dev@httpd.apache.org In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-LamXPFdECYl/1yCl6aeF" Date: Thu, 21 Jun 2012 13:42:31 +1000 Message-ID: <1340250151.6625.15.camel@tardis> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 --=-LamXPFdECYl/1yCl6aeF Content-Type: multipart/related; type="multipart/alternative"; boundary="=-VThCfc1N2ChRT9hnCCge" --=-VThCfc1N2ChRT9hnCCge Content-Type: multipart/alternative; boundary="=-i45H5jGquqD3C+Fy48bL" --=-i45H5jGquqD3C+Fy48bL Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable On Wed, 2012-06-20 at 22:52 +0200, Stefan Fritsch wrote: > On Wed, 20 Jun 2012, Nick Edwards wrote: > > I posted this to users list last week but no-one bit, so I'm trying her= e. > > > > With md5crypt no longer recommended for use by its author, will Apache > > soon support sha256/sha512 in basic authentication via MySQL. >=20 > Note that it does not really matter that much which hash algorithm is=20 > used. The number of rounds is more important. APR-MD5 ("$apr1$") does 100= 0=20 > times recursive md5 (which is 1000 times more secure in terms of brute=20 > forcing than plain md5). We should switch to something that needs more=20 > processing time so that it is more difficult to brute force. >=20 yup, I'm not a crypto expert but IIRC sha512 by default uses rounds=3D5000 (if not rounds=3D is not specified) I brought this up with (I think it was) Bill, a year ago (using SHA2) and at that time there were no plans, however, in light of recent events, I'd agree it needs to be revisited. > > > > For Mail and FTP, we are _now_ successfully using crypt($password, > > '$6$' . $16charsalt) for sha512, be nice if Apache basic auth would > > too! >=20 > APR passes everything it doesn't know to the system's crypt() function. S= o=20 > chances are good that using $6$... already works for you. However, there=20 > is currently no way to create such hashes with htpasswd. >=20 If the OP is using crypt() correctly with a modern nix OS it certainly will, I've been using sha512 for a while. I'm surprised he did not just "try it", he might have had his answer a week ago. in perl I've been using $psalt=3D join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[map {rand 64} (0..15)]; $epass =3D crypt($PASS, '$6$' . $psalt); the end result will be readable by httpd to auth users In php, I've used=20 $psalt =3D uniqid(16); <-- yes i know a bad cheat :) ... but I'm far from knowledgeable with php $epass =3D crypt($PASS,'$6$'.$csalt); --=-i45H5jGquqD3C+Fy48bL Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, 2012-06-20 at 22:52 +0200, Stefan Fritsch wrote:
On Wed, 20 Jun 2012, Nick Edwards wrote:
> I posted this to users list last week but no-one bit, so I'm trying he=
re.
>
> With md5crypt no longer recommended for use by its author, will Apache
> soon support sha256/sha512 in basic authentication via MySQL.

Note that it does not really matter that much which hash algorithm is=20
used. The number of rounds is more important. APR-MD5 ("$apr1$") =
does 1000=20
times recursive md5 (which is 1000 times more secure in terms of brute=20
forcing than plain md5). We should switch to something that needs more=20
processing time so that it is more difficult to brute force.


yup, I'm not a crypto expert but IIRC sha512 by default uses rounds=3D5000&= nbsp; (if not rounds=3D is not specified)

I brought this up with (I think it was) Bill, a year ago (using SHA2) and a= t that time there were no plans, however, in light of recent events, I'd ag= ree it needs to be revisited.

>
> For Mail and FTP, we are _now_ successfully using  crypt($password,
> '$6$' . $16charsalt) for sha512, be nice if Apache basic auth would
> too!

APR passes everything it doesn't know to the system's crypt() function. So=20
chances are good that using $6$... already works for you. However, there=20
is currently no way to create such hashes with htpasswd.


If the OP is using crypt() correctly with a modern nix OS it certainly will= , I've been using sha512 for a while.
I'm surprised he did not just "try it", he might have had his ans= wer a week ago.

in perl I've been using

$psalt=3D  join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[map {rand 64}= (0..15)];
$epass =3D crypt($PASS, '$6$' . $psalt);

the end result will be readable by httpd to auth users

In php, I've used

$psalt =3D uniqid(16);    <-- yes i know a bad cheat ... but I'm far from knowledgeable with php
$epass =3D crypt($PASS,'$6$'.$csalt);


--=-i45H5jGquqD3C+Fy48bL-- --=-VThCfc1N2ChRT9hnCCge Content-ID: <1340249803.6625.8.camel@tardis> Content-Disposition: attachment; filename="face-smile.png" Content-Type: image/png; name="face-smile.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJ TUUH1wgOER8RqU5d7gA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Cfc1N2ChRT9hnCCge-- --=-LamXPFdECYl/1yCl6aeF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEcBAABAgAGBQJP4pggAAoJECg/hgl/0DbH9MAH/3xiad9mEgHEoeZEtfneTTag KhvzNXAvRgwS49OpGS3FgJWy9e+WWjI2BpdfGZK0By7mG0yXadLgzkCHeusizDY3 fK8cOAnpnrux71+3SocVEsOnG9nuuTsul9zv8AflGHF/Wj24w9XWZQ9gwf6bidF9 W8EN6FC+84Xeyc3qVeGARrSOvxiAhHJn9QItiYxuAPBWkUJpVHfvMl4SDiQjhyPq iBKKsYgZWFJPFJ/aigfL5UflvyXeIU0QPpor7PkEBapIUq8LLFRN9R8Z7c7yuSA2 vxc+uZA/qGXYJ2eBI+c2I0/ZSlZXzO25cG0hmxenhbgDeMecK1C66AHYkcV92UA= =2r3I -----END PGP SIGNATURE----- --=-LamXPFdECYl/1yCl6aeF--