aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/timeattack.c
Commit message (Collapse)AuthorAgeFilesLines
* Use standard unsigned integer typesAndreas Steffen2016-03-241-5/+5
|
* utils: Add a constant time chunk_equals() variant for cryptographic purposesMartin Willi2015-04-141-1/+47
|
* utils: Add a constant time memeq() variant for cryptographic purposesMartin Willi2015-04-141-1/+8
|
* scripts: Add a tool that tries to guess MAC/ICV values using validation timesMartin Willi2015-04-141-0/+365
This tool shows that it is trivial to re-construct the value memcmp() compares against by just measuring the time the non-time-constant memcmp() requires to fail. It also shows that even when running without any network latencies it gets very difficult to reconstruct MAC/ICV values, as the time variances due to the crypto routines are large enough that it gets difficult to measure the time that memcmp() actually requires after computing the MAC. However, the faster/time constant an algorithm is, the more likely is a successful attack. When using AES-NI, it is possible to reconstruct (parts of) a valid MAC with this tool, for example with AES-GCM. While this is all theoretical, and way more difficult to exploit with network jitter, it nonetheless shows that we should replace any use of memcmp/memeq() with a constant-time alternative in all sensitive places.