bfhash(1)

bfhash(1) ALT Linux bfhash(1)

NAME

bfhash - generate Blowfish hash suitable for TCB/shadow usage

SYNTAX

bfhash [{password|-} [{salt|salt depth}]]

DESCRIPTION

BFHash generates a Blowfish hash suitable for using in Blowfish-oriented authentication token storage like linux shadow or TCB password storages.

When used wihtout any parameter or in bfhash - form, reads string to be hashed from stdin, the first parameter is hashed otherwise.

One can specify certain salt or salt depth (number of iterations) used in hashing. Extra salt characters are ignored. Default is to generate salt randomly with the depth of 8.

This small program is just a shell wrapper over Damien Miller's py-bcrypt python module. It was written to avoid lack of command-line Blowfish hashing utility.

EXAMPLES

To create TCB-compatible password hash just type:


$ bfhash Password

To provide alternative 12 salt depth (repeat rounds) instead of 8 and read password from stdin, thus it cannot be peeped through process cmdline:


$ bfhash - 12

To provide custom salt:


$ bfhash Password '$2a$08$saltsaltsaltsaltsaltsalt'

To check $PASSWORD against known $HASH (notice using $HASH instead of just salt; all extra characters are ignored):


$ test `bfhash $PASSWORD $HASH` = $HASH && echo Yes || echo No

ERRORS

When providing full salt, always use strings longer than actual salt length (trail characters will be truncated anyway). This is the the way py-bcrypt works for now.

AUTHORS

George V. Kouryachy (Fr. Br. George <george@altlinux.org>).

SEE ALSO

blowfish(3), login.defs(5), Damien Miller's py-bcrypt documentation

Wed, 9 Apr 2014 Fr. Br. George