-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
If you enter a long password it will take significantly longer. This runs in O(pwLen * rounds)
time instead of in O(pwLen + rounds)
time.
Ideally you'd want to do a cached HMAC for a 2x speed increase (on normal sized passwords):
var cachedCtx = createHmac(digest, password)
...
-var T = createHmac(digest, password).update(block1).digest()
+var T = "cachedCtx.clone()".update(block1).digest()
...
-U = createHmac(digest, password).update(U).digest()
+U = "cachedCtx.clone()".update(U).digest()
Their are some problems with the "create-hmac" package and once those are fixed cached HMAC will be the best way to go. See browserify/createHmac#27. Also I do not know the proper way to clone an object in Node.js. Thus the quotes around cachedCtx.clone()
.
Metadata
Metadata
Assignees
Labels
No labels