diff options
author | lloyd <[email protected]> | 2011-02-17 19:41:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-02-17 19:41:49 +0000 |
commit | 20b9d66dc60595e685d99f59a7ef306074d8e0b1 (patch) | |
tree | d3f743ce470368cf6764c126021c5aa726267504 /src/block/blowfish | |
parent | 88a892707f05625cbcf0c8cc4b3e0ed7852967b5 (diff) |
Move password hashing schemes to src/passhash
Set the upper limit on bcrypt hashing to workfactor 18, which takes
about 25 seconds to run on my desktop machine.
Diffstat (limited to 'src/block/blowfish')
-rw-r--r-- | src/block/blowfish/blowfish.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/block/blowfish/blowfish.cpp b/src/block/blowfish/blowfish.cpp index 6610decd8..b6319eec0 100644 --- a/src/block/blowfish/blowfish.cpp +++ b/src/block/blowfish/blowfish.cpp @@ -117,7 +117,12 @@ void Blowfish::eks_key_schedule(const byte key[], size_t length, if(workfactor == 0) throw std::invalid_argument("Bcrypt work factor must be at least 1"); - if(workfactor > 24) // ok? + /* + * On a 2.8 GHz Core-i7, workfactor == 18 takes about 25 seconds to + * hash a password. This seems like a reasonable upper bound for the + * time being. + */ + if(workfactor > 18) throw std::invalid_argument("Requested Bcrypt work factor too large"); clear(); |