5 ms·
Just out of curiousity, I wanted to know what you think.. I realize that the problem is that the PKCS padding exception is timeable. Please correct me if this i
by dev360 16y ago
Just out of curiousity, I wanted to know what you think.. I realize that the problem is that the PKCS padding exception is timeable. Please correct me if this is naive, but what if I devised some code that did either of the following:
1. decrypt the string; if a padding exception occurs, then run a decrypt of a string the same size with correct padding. do not throw an error.
2. decrypt the string; if a padding exception does not occur, then run some instructions on a string with the same size and incorrect padding, forcing a padding error.
In both 1 & 2, we do not throw any visible errors to the user. Wouldn't this at least shrink the measurable difference significantly by ensuring that the instruction set is always going to be the same, and hopefully average out closer to a constant time, regardless of whether an error "occurs"?