邪恶八进制信息安全团队技术讨论组's Archiver

EvilOctal 2006-2-19 04:16

[转载]Modern Password Hashing Algorithm for Crypt——crypt_blowfish

原始连接:<A href="http://www.openwall.com/crypt/">[url]http://www.openwall.com/crypt/[/url]</A>
<P><SMALL><I><FONT size=2>Please note that password hashing is often wrongly referred to as "password encryption". Hashing is a more appropriate term since encryption is something which is supposed to be easily reversible. </FONT></I></SMALL>
<P>This is an implementation of a modern password hashing algorithm, based on the <A href="http://www.counterpane.com/blowfish.html">Blowfish</A> block cipher, provided via the crypt(3) and a reentrant interface. It is compatible with <I>bcrypt</I> (version 2a) by <A href="http://www.citi.umich.edu/u/provos/">Niels Provos</A> and David Mazieres, as used in <A href="http://www.openbsd.org/">OpenBSD</A>. A paper on the algorithm that explains its design decisions is available <A href="http://www.usenix.org/events/usenix99/provos.html">here</A>.
<P>The most important property of <I>bcrypt</I> (and thus crypt_blowfish) is that it is adaptable to future processor performance improvements, allowing you to arbitrarily increase the processing cost of checking a password while still maintaining compatibility with your older password hashes. Already now <I>bcrypt</I> hashes you would use are several orders of magnitude stronger than traditional Unix DES-based or FreeBSD-style MD5-based hashes.
<P>Today, a number of other operating systems, besides OpenBSD, support <I>bcrypt</I> password hashes, with Niels' original implementation, with this implementation (crypt_blowfish), or otherwise. These systems include recent versions of FreeBSD and NetBSD, Solaris 10, and indeed the Linux distributions which have integrated crypt_blowfish (see below for a list). Only some of these systems use <I>bcrypt</I> for newly set passwords by default, though.
<P>This code comes from <A href="http://www.openwall.com/john/">John the Ripper</A> password cracker, and is placed in the public domain to let you use this on your system, as a part of a software package, or anywhere else to improve security, ensure compatibility, or for any other purpose. There's no license to worry about, not even a BSD-style copyright.
<P>You can use the provided routines in your own packages or link them into a C library. Hooks for linking into GNU libc are provided. Note that simply adding this code into your libc is probably not enough to make your system use the new password hashing algorithm. Changes to passwd(1), PAM modules, or whatever else your system uses will likely be needed as well. These are not a part of this package, but there's <I>pam_tcb</I> in the <A href="http://www.openwall.com/Owl/">Openwall GNU/*/Linux</A> (Owl) <A href="http://www.openwall.com/tcb/">tcb</A> package which uses the password hashing framework provided by crypt_blowfish, and there are the Owl <A href="http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/shadow-utils/">shadow suite patches</A> (in particular, the <I>crypt_gensalt</I> patch) available from our <A href="http://cvsweb.openwall.com/">CVSweb server</A>.
<P>You may also want to check out our <A href="http://www.openwall.com/phpass/">portable PHP password hashing framework</A> for use in your PHP applications.
<P>Download:
<UL>
<LI><A href="http://www.openwall.com/crypt/crypt_blowfish-1.0.tar.gz">crypt_blowfish 1.0</A> and its <A href="http://www.openwall.com/crypt/crypt_blowfish-1.0.tar.gz.sign">signature</A>
<LI><A href="http://www.openwall.com/crypt/openwall-crypt.3.ps.gz">Openwall GNU/*/Linux crypt(3) manual page (gzipped PostScript)</A> and its <A href="http://www.openwall.com/crypt/openwall-crypt.3.ps.gz.sign">signature</A> </LI></UL>
<P>These files are also available via <A href="ftp://ftp.openwall.com/pub/projects/crypt/">FTP</A>.
<P>Follow <A href="http://www.openwall.com/signatures/">this link</A> for information on verifying the signatures.
<P>We may help you integrate crypt_blowfish into your software or OS installs, please check out our <A href="http://www.openwall.com/services/">services</A>.
<P>Contributed crypt_blowfish resources:
<UL>
<LI><A href="http://www.openwall.com/crypt/contrib/shadow-19990827-crypt_blowfish.diff.gz">shadow-19990827 patch for Slackware 7</A>, by Matthew Dainty
<LI><A href="http://www.openwall.com/crypt/contrib/shadow-4.0.3-crypt_blowfish.diff.gz">shadow-4.0.3 patch for Slackware 10</A>, updated by Grzegorz Blach
<LI>shadow-4.0.9 patches updated by neeo, <A href="http://www.openwall.com/crypt/contrib/shadow-4.0.9-crypt_blowfish+tcb-1.tar.gz">based on Matthew Dainty's crypt_blowfish support patch</A> or <A href="http://www.openwall.com/crypt/contrib/shadow-4.0.9-crypt_blowfish+tcb-2.tar.gz">based on the Owl "crypt_gensalt" patch</A> (recommended).<BR>Both archives also include the Owl tcb patch updated to apply after the corresponding crypt_blowfish support patch. Unfortunately, the documentation updates <A href="http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/shadow-utils/">found in Owl</A> have been dropped from this quick and dirty update of the patches. </LI></UL>
<P>crypt_blowfish is fully integrated into <A href="http://www.openwall.com/Owl/">Owl</A> and distributions by <A href="http://www.altlinux.com/">ALT Linux</A> team, as the default password hashing scheme. It is a part of the glibc package on <A href="http://www.asplinux.ru/en/">ASPLinux</A> and <A href="http://www.suse.de/en/">SuSE Linux</A>.
<P>Additionally, crypt_blowfish is used in the <A href="http://www.hardened-php.net/">PHP Hardening-Patch</A>, in PostgreSQL's contrib/pgcrypto providing <I>bcrypt</I> support for crypt() and gen_salt() SQL functions, and in CommuniGate Pro messaging server starting with version 4.1 (but you need to explicitly configure CGP to use "UB-crpt" "password encryption" in order to have it produce <I>bcrypt</I> hashes for new passwords).
<P>Support further work on this software with <A href="http://www.openwall.com/donations/">donations</A>. </P>

页: [1]
© 1999-2008 EvilOctal Security Team