You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that you use a timing safe equals comparison method in verifyCode(), yet this method itself is not time safe. That seems to be a bit of a contradiction. It has to do with the return inside the for loop:
Depending on the time slice in which a match is found the verifyCode() method will take longer or shorter to execute. To be honest, I don't see how this can be exploited in a timing attack, but still, why not simply get rid of this problem? Something like:
I've noticed that you use a timing safe equals comparison method in
verifyCode()
, yet this method itself is not time safe. That seems to be a bit of a contradiction. It has to do with thereturn
inside thefor
loop:Depending on the time slice in which a match is found the
verifyCode()
method will take longer or shorter to execute. To be honest, I don't see how this can be exploited in a timing attack, but still, why not simply get rid of this problem? Something like:Now the time this piece of code takes to execute does no longer depend on when a match is found.
The text was updated successfully, but these errors were encountered: