From owner-freebsd-current@FreeBSD.ORG Fri Feb 28 01:47:40 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0283519D for ; Fri, 28 Feb 2014 01:47:40 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B780B1DE3 for ; Fri, 28 Feb 2014 01:47:39 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s1S1lZLI064909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Feb 2014 17:47:36 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s1S1lYNX064908; Thu, 27 Feb 2014 17:47:34 -0800 (PST) (envelope-from jmg) Date: Thu, 27 Feb 2014 17:47:34 -0800 From: John-Mark Gurney To: Allan Jude Subject: Re: Feature Proposal: 'rounds' tuneables for crypt() algorithms Message-ID: <20140228014734.GL47921@funkthat.com> Mail-Followup-To: Allan Jude , FreeBSD Current References: <530FE64A.4090808@allanjude.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <530FE64A.4090808@allanjude.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 27 Feb 2014 17:47:36 -0800 (PST) Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 01:47:40 -0000 Allan Jude wrote this message on Thu, Feb 27, 2014 at 20:28 -0500: > Currently, you can change the password hashing algorithm used by crypt() > with the passwd_format in /etc/login.conf > > However, as far as I could find, you cannot change the number of > 'rounds', the dynamic adjustment factor using in bcrypt, and > sha256crypt, and sha512crypt. > > bcrypt uses a log number, the default is 4 (so 2^4 rounds). The minimum > is currently 4, and the maximum 31 > > sha256 and sha512crypt default to 5000, with a minimum of 1000 and a > maximum of 999999999 > > OpenBSD implements this in login.conf with 'localcipher' similar to our > 'passwd_format', except it takes an optional 2nd parameter, the number > of log2() rounds. > > Arch implements this in pam_unix with rounds= > > For compatibility, it might make most sense to use a separate variable > rather than adding the optional parameter to the existing passwd_format, > so older boxes do not choke on it. > > Thoughts? There is already a patch out there to do this.. It basicly adds a string to login.conf that is the first part of the crypt that you want to use which will provide the number of rounds too... I think it was posted to -current... I've been meaning to look at adding it... The reason I'm interested in doing this is so that we can configure the number of rounds at boot time... Say always take 50ms to run the rounds or a minimum number of rounds.. This way on faster boxes you get added security of extra -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."