Documentation


Manual in PDF format.

man pages

Examples


db2 => values bcrypt('cleartext')

1
------------------------------------------------------------
$2y$05$WCC47DM2xelWQCGDKEAeNOP9BCRE6IyuMjOtGH5hKMB392XuSWInG

  1 record(s) selected.
db2 => call bcrypt('cleartext', ?)

  Value of output parameters
  --------------------------
  Parameter Name  : HASH
  Parameter Value : $2y$05$vo.ybx/7TPTqB7w.RtdLf.M7rqjG5UIJ1wJpSRdIfOxg9CIBNDU3S

  Return Status = 0
db2 => call validate_pw('cleartext', '$2y$05$vo.ybx/7TPTqB7w.RtdLf.M7rqjG5UIJ1wJpSRdIfOxg9CIBNDU3S', ?)

  Value of output parameters
  --------------------------
  Parameter Name  : IS_VALID
  Parameter Value : 1

  Return Status = 0
db2 => values validate_pw('wrong cleartext', '$2y$05$vo.ybx/7TPTqB7w.RtdLf.M7rqjG5UIJ1wJpSRdIfOxg9CIBNDU3S', ?)

1
-----------
          0

  1 record(s) selected.
db2 => values apr_sha256('cleartext')

1
----------------------------------------------------
{SHA256}BQF0CEQFCEafJRsQjaPfZ8YBq5Fm80WqLBr9s90f8tw=

  1 record(s) selected.
db2 => values sha256('cleartext')

1
-------------------------------------------------------
$5$Yj7xpt8h$wkod.Gp8Uviu4OhYguPgUYq.aPGcIbWInz1fnvDC1I1

  1 record(s) selected.

Support


Having trouble with db2-hash-routines? Please open a ticket here.