openwall / crypt_blowfish

Implementation of bcrypt password hashing scheme

Home Page:https://www.openwall.com/crypt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is an implementation of a password hashing method, provided via the
crypt(3) and a reentrant interface.  It is fully compatible with
OpenBSD's bcrypt.c for prefix "$2b$", originally by Niels Provos and
David Mazieres.  (Please refer to the included crypt(3) man page for
information on minor compatibility issues for other bcrypt prefixes.)

I've placed this code in the public domain, with fallback to a
permissive license.  Please see the comment in crypt_blowfish.c for
more information.

You can use the provided routines in your own packages, or link them
into a C library.  I've provided hooks for linking into GNU libc, but
it shouldn't be too hard to get this into another C library.  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 see
LINKS for a pointer to our tcb suite.

Instructions on using the routines in one of the two common ways are
given below.  It is recommended that you test the routines on your
system before you start.  Type "make check" or "make check_threads"
(if you have the POSIX threads library), then "make clean".


1. Using the routines in your programs.

The available interfaces are in ow-crypt.h, and this is the file you
should include.  You won't need crypt.h.  When linking, add all of the
C files and x86.S (you can compile and link it even on a non-x86, it
will produce no code in this case).


2. Building the routines into GNU C library.

For versions 2.13 and 2.14 (and likely other nearby ones), extract the
library sources as usual.  Apply the patch for glibc 2.14 provided in
this package.  Enter crypt/ and rename crypt.h to gnu-crypt.h within
that directory.  Copy the C sources, header, and assembly (x86.S) files
from this package in there as well (but be sure you don't overwrite the
Makefile).  Configure, build, and install the library as usual.

For versions 2.2 to 2.3.6 (and likely also for some newer ones),
extract the library sources and maybe its optional add-ons as usual.
Apply the patch for glibc 2.3.6 provided in this package.  Enter
crypt/ and rename crypt.h to gnu-crypt.h within that directory.  Copy
the C sources, header, and assembly (x86.S) files from this package in
there as well (but be sure you don't overwrite the Makefile).
Configure, build, and install the library as usual.

For versions 2.1 to 2.1.3, extract the library sources and the crypt
and linuxthreads add-ons as usual.  Apply the patch for glibc 2.1.3
provided in this package.  Enter crypt/sysdeps/unix/, and rename
crypt.h to gnu-crypt.h within that directory.  Copy C sources, header,
and assembly (x86.S) files from this package in there as well (but be
sure you don't overwrite the Makefile).  Configure, build, and install
the library as usual.

Programs that want to use the provided interfaces will need to include
crypt.h (but not ow-crypt.h directly).  By default, prototypes for the
new routines aren't defined (but the extra functionality of crypt(3)
is indeed available).  You need to define _OW_SOURCE to obtain the new
routines as well.

-- 
Solar Designer <solar at openwall.com>

$Owl: Owl/packages/glibc/crypt_blowfish/README,v 1.10 2014/07/07 15:19:04 solar Exp $

About

Implementation of bcrypt password hashing scheme

https://www.openwall.com/crypt/


Languages

Language:C 70.2%Language:Roff 20.8%Language:Assembly 5.3%Language:Makefile 2.6%Language:C++ 1.0%