libhydrogen icon indicating copy to clipboard operation
libhydrogen copied to clipboard

Leaked public keys of KK_variant?

Open KamiK2K opened this issue 2 years ago • 3 comments

Hi,

I am trying to use the KK_variant of the key exchange mechanism, where public keys of parties (generated using hydro_kx_keygen function) is exchanged in the clear. Does this endanger the security of the tx and rx session key pairs?

This is considering the fact that I have authenticated both sides with signature verification. Detailed steps is the attached picture (both sides know each other public keys for signature verification).

image

KamiK2K avatar Aug 17 '22 22:08 KamiK2K

Is the connection between device and PC in step 3 trusted in your design?

Crest avatar Aug 18 '22 11:08 Crest

No its not trusted in that step, its a Bluetooth or USB connection,

In other words the ephemeral public key of the device generated at step 3 can be sniffed by other devices,

But I regenerate those keys using hydro_kx_keygen() function call to provide forward secrecy for each session,

each session usually lasts few hours,

so in this case, my main question is if the public keys of both sides generated using hydro_kx_keygen() function for each session gets received by other devices, does that impose a threat for security of that session? Can the attacker somehow recover the session keys? and decrypt the exchanged messages?

Can I ask for you help @jedisct1 on this please?

KamiK2K avatar Aug 18 '22 12:08 KamiK2K

This is perfectly fine. Public keys can be leaked (hence "public"); it doesn't allow an attacker to recover the session key without the corresponding secret key.

jedisct1 avatar Aug 18 '22 19:08 jedisct1