Commit Graph

7 Commits

Author SHA1 Message Date
tom-bop
1288127d8e Fix typo in bcrypt example 2018-08-30 17:47:59 +01:00
Luke Taylor
d27d464627 Fix cost parsing for bcrypt
The tens value was wrong for values of 20+, as reported in #230.
It should be 10*costTens not 10^costTens. This wasn't detected because
the values are the same when costTens is 1, and using high cost values
is rare with bcrypt because of the performance hit.

Also added a simple hash and validate test since the KAT tests only do
validation. This doesn't cover this bug since the cost value is too
high to include in the test. It allows similar issues to be tested
locally though.
2018-04-17 13:51:04 +01:00
Luke Taylor
5e354f9bfc Use "2b" version prefix in bcrypt hashes
Makes docs and code consistent - the code now generates hashes
with the "2b" prefix instead of "2a". Shouldn't make any difference
in practice since previously generated hashes should still validate.
2017-11-27 15:19:23 +00:00
Vincent Hanquez
f362d50d46 [bcrypt] make the haddock comment reflect what happens to the cost value.
also fix a tpyo
2016-02-25 07:48:30 +00:00
Luke Taylor
6d33b66245 BCrypt module doc updates
- Add doctest style example usage
- List most relevant functions
- Reformat comments
- Minor corrections and additions
2015-09-01 15:22:58 +01:00
Luke Taylor
f346c46243 Add BCrypt module doc and a validatePasswordEither fn 2015-08-26 10:33:36 +01:00
Luke Taylor
39d5eb13fe Add bcrypt password hashing and validation API 2015-08-26 10:33:36 +01:00