WhatsApp had recently announced end-to-end encryption on all communications. While that's an impressive move, I still have a big open question mark.
The articles and this white paper suggest that the public key, upon generation, gets stored on the server. When I want to speak to another person, I ask the WhatsApp server for their public key, and use that in communication. That same white paper says this about key verification:
WhatsApp users additionally have the option to verify the keys of the other users with whom they are communicating so that they are able to confirm that an unauthorized third party (or WhatsApp) has not initiated a man-in-the-middle attack. This can be done by scanning a QR code, or by comparing a 60-digit number.
Oh, that's nice, how are those things generated?
The QR code contains:
- A version.
- The user identifier for both parties.
- The full 32-byte public Identity Key for both parties.
When either user scans the other’s QR code, the keys are compared to ensure that what is in the QR code matches the Identity Key as retrieved from the server.
But... those are all details that the server knows, and requires nothing special from the other person (it doesn't mention the QR being signed). How about the 60 digit number?
The 60-digit number is computed by concatenating the two 30-digit numeric fingerprints for each user’s Identity Key. To calculate a 30-digit numeric fingerprint:
- Iteratively SHA-512 hash the public Identity Key and user identifier 5200 times.
- Take the first 30 bytes of the final hash output.
- Split the 30-byte result into six 5-byte chunks.
- Convert each 5-byte chunk into 5 digits by interpreting each 5-byte chunk as a big-endian unsigned integer and reducing it modulo 100000.
- Concatenate the six groups of five digits into thirty digits.
Again, those are details the server can easily calculate and present to me as valid verification data.
Am I misunderstanding this, or is there no real way of verifying that the public key I'm talking to belongs to the person I think it does?