An interesting, seemingly minor, flaw

submited by
Style Pass
2024-06-10 17:00:09

Of the talks that I attended at Blackhat in 2018, the most interesting was about how mangling a carry bit in a P- 256 calculation enabled compromise of a private key. This is a big deal.

Modern encryption often uses Elliptic-curve cryptography. It is used in setting up secure communication channels between two computers, say your laptop and a web server. It is also used in “signing”, a way to be sure that a key piece of information has not been tampered with. One example of this is to verify that a web site is who it claims it is. There are several other uses described in Wikipedia.

For two parties to agree on the validity of keys that they are exchanging, some rather involved arithmetic with numbers that are 256 bits long, Since most hardware does at most 64-bit arithmetic, the program must use multi-precision arithmetic to do the calculations.

Thus, the program must mimic what you would do when you are adding or multiplying multi-digit numbers. If two digits added result in a number greater than 10, you need to carry the one to the next leftmost column. In the case of the cryptography, you need to account for two 64-bit numbers added together have a carry. With 64-bit numbers added together, the program needs to explicitly handle that case.

Leave a Comment