validate_pw(8) DB2 User Defined Function and Stored Procedure validate_pw(8)
NAME
validate_pw - DB2 UDF and SP to validate a password against a hash
SYNOPSIS
>>-VALIDATE_PW--(--password--,--hash--)------------------------><
>>-VALIDATE_PW--(--password--,--hash--,--is_valid--)-----------><
DESCRIPTION
This routine can be used to validate a password against a hash.
The two input arguments can be character strings that are either a CHAR
or VARCHAR not exceeding 4096 bytes (password) and 120 bytes (hash).
The second parameter (hash) must not be empty, otherwise an SQLSTATE
39701 is returned.
The result of the routine is an INTEGER. If the password is valid, 1 is
returned. If the password is not valid, 0 is returned. The result can
be null; if the argument is null, the result is the null value.
EXAMPLES
Example 1:
Validating the password testpwd against the crypt hash cqs7uOvz8KBlk.
SELECT validate_pw('testpwd', 'cqs7uOvz8KBlk') FROM SYSIBM.SYSDUMMY1"
1
-----------
1
1 record(s) selected.
Example 2:
CALL validate_pw('testpwd', 'cqs7uOvz8KBlk', ?)
Value of output parameters
--------------------------
Parameter Name : IS_VALID
Parameter Value : 1
Return Status = 0
Example 3:
CALL validate_pw('testpwd', '0123456789abcdef', ?)
Value of output parameters
--------------------------
Parameter Name : IS_VALID
Parameter Value : 0
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
validate_pw June 2015 validate_pw(8)