diff options
Diffstat (limited to 'src/block/blowfish/blowfish.cpp')
-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(); |