IssueRaiser

Tox Handshake Vulnerable to KCI

Hello, I found this source code confusingly written (and downright scary at times) and the [specification](https://toktok.github.io/spec) woefully underspecified and inexplicit, so it's entirely possible my understanding of the handshake is _inaccurate_. But on the off-chance that 5 minutes of source code review at 4am yielded something accurate, here is my understanding of the handshake: Peer A (Alice) has the longterm static keypair `(S_A^{pub}, S_A^{priv})`. Peer A has the session-generated ephemeral keypair `(E_A^{pub}, E_A^{priv})`. Peer B (Bob) has the longterm static keypair `(S_B^{pub}, S_B^{priv})`. Peer B has the session-generated ephemeral keypair `(E_B^{pub}, E_B^{priv})`. Message 1: A -> B ``` XAEAD(key=ECDH(S_A^{priv}, S_B^{pub}), payload=E_A^{pub}) ``` Message 2: B -> A ``` XAEAD(key=ECDH(S_B^{priv}, S_A^{pub}), payload=E_B^{pub}) ``` Session Key Derivation ``` ECDH(E_A^{priv}, E_B^{pub}) = ECDH(E_B^{priv}, E_A^{pub}) ``` Is this an accurate representation of the handshake? If so, keep reading. If not, you may safely stop reading here, close the issue, and accept my apologies for the misunderstanding. The issue is that this naive handshake is vulnerable to key-compromise impersonation, something that basically all modern authenticated key exchanges (AKEs) are designed to protect against. Concretely, the issue is that if A's longterm static private key is stolen, an attacker can impersonate anybody to A without A realizing. Let's say that Mallory, M, has

Posted by zx2c4 on Jan 13, 2017, 3:20 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Software)

Tox Handshake Vulnerable to KCI

zx2c4Jan 13, 2017, 3:20 PM

Hello, I found this source code confusingly written (and downright scary at times) and the [specification](https://toktok.github.io/spec) woefully underspecified and inexplicit, so it's entirely possible my understanding of the handshake is _inaccurate_. But on the off-chance that 5 minutes of source code review at 4am yielded something accurate, here is my understanding of the handshake: Peer A (Alice) has the longterm static keypair `(S_A^{pub}, S_A^{priv})`. Peer A has the session-generated ephemeral keypair `(E_A^{pub}, E_A^{priv})`. Peer B (Bob) has the longterm static keypair `(S_B^{pub}, S_B^{priv})`. Peer B has the session-generated ephemeral keypair `(E_B^{pub}, E_B^{priv})`. Message 1: A -> B ``` XAEAD(key=ECDH(S_A^{priv}, S_B^{pub}), payload=E_A^{pub}) ``` Message 2: B -> A ``` XAEAD(key=ECDH(S_B^{priv}, S_A^{pub}), payload=E_B^{pub}) ``` Session Key Derivation ``` ECDH(E_A^{priv}, E_B^{pub}) = ECDH(E_B^{priv}, E_A^{pub}) ``` Is this an accurate representation of the handshake? If so, keep reading. If not, you may safely stop reading here, close the issue, and accept my apologies for the misunderstanding. The issue is that this naive handshake is vulnerable to key-compromise impersonation, something that basically all modern authenticated key exchanges (AKEs) are designed to protect against. Concretely, the issue is that if A's longterm static private key is stolen, an attacker can impersonate anybody to A without A realizing. Let's say that Mallory, M, has

Comments (0)

No comments yet. Start the discussion.

Comment on this issue