bcrypt(8)       DB2 User Defined Function and Stored Procedure       bcrypt(8)




NAME

       bcrypt - DB2 UDF and SP to generate an SHA1 hash


SYNOPSIS

       >>-BCRYPT--(--expression--)------------------------------------><

       >>-BCRYPT--(--expression--,--hash--)---------------------------><


DESCRIPTION

       bcrypt algorithm. The bcrypt routine is compatible to the function used
       in Apache's htpasswd utility.

       The argument can be a character string that is either a CHAR or VARCHAR
       not exceeding 4096 bytes.

       The  result of the function is CHAR(60). The result can be null; if the
       argument is null, the result is the null value.


EXAMPLES

       Example 1:

       Inserting the user test and the sha1 crypted clear text testpwd to  the
       table users.

       INSERT INTO USERS (username, password)
         VALUES ('test', bcrypt('testpwd'))

       Example 2:

       SELECT bcrypt('testpwd') FROM SYSIBM.SYSDUMMY1

       1
       ------------------------------------------------------------
       $2y$05$2jb66aPElSkNLT1t8e6dQepuCY2BP3JnYUh0xeV9r1PEoOGyOLkym

         1 record(s) selected.

       Example 3:

       CALL bcrypt('testpwd', ?)

         Value of output parameters
         --------------------------
         Parameter Name  : HASH
         Parameter Value : $2y$05$WYSu1X6PVA0Ra.aPSjrdv.S6hOp.AYSnNRT521rmLRjD4Mj9UY6ve

         Return Status = 0


AUTHOR

       Written by Helmut K. C. Tessarek.


BUGS

       Hopefully none :-) But if you find one, please report it at:
       https://github.com/tessus/db2-hash-routines/issues


WEB SITE

       http://tessus.github.io/db2-hash-routines



bcrypt                             June 2015                         bcrypt(8)