3
$\begingroup$

I implemented the Diffie-Hellman Key Exchange algorithm but, I was wondering how to handle if one of the parties lost his key.

Let's take a chat app as an example, Bob and Alice they used to have a shared key, but sadly Alice changed his device, and what if Bob sent a message to her encrypted with the shared key while she was offline. How can this be handled?

Not Sure about this solution: Can I once Alice logs in with the new mobile device it requests from her room users to re-authenticate? and how about that message that Bob sent pre-re-authentication?

Thanks in advance. :)

EDIT ONE

As @kelalaka said, I can send an excuse to bob by re-auth and resending the message from his device.

$\endgroup$
  • 1
    $\begingroup$ You have to send the key securely and this is complicated need additional protocol. Otherwise, the key-exchange algorithm is randomized, and re-run will not produce the same key. Better is send a key-lost event, re-execute Diffie-Hellman and re-send the message. $\endgroup$ – kelalaka Nov 11 '18 at 22:12
  • 1
    $\begingroup$ Changing devices is a known problem for these kind of apps. There is probably no silver bullet. Actually, if a messaging service would say that you can add devices and decrypt previous messages I would assume that they can probably also decrypt messages. This is doubly true if the org. device is lost. $\endgroup$ – Maarten Bodewes Nov 12 '18 at 0:15
  • 1
    $\begingroup$ The simplistic but insecure approach is for Alice to make a backup of the negotiated key (hopefully protected with a passphrase) before she has lost her device; then she can later use her backup to restore the key to her new device. But this isn't very secure, as Eve might have found Alice's old device and extracted the key from it, which would enable her to eavesdrop on the messages that Bob sends to Alice. $\endgroup$ – kiwidrew Nov 12 '18 at 5:23
  • $\begingroup$ @kelalaka Hey, thanks for the answer, I've been working since then for a more creative way and also waiting better answers, but didn't find. I think you should post it as a solution so I can mark it as solved. thanks. Thanks everybody for the effort, you all explained and had great ideas too. :) $\endgroup$ – Aly Hassan Nov 14 '18 at 20:51
2
$\begingroup$

You have to send the previously generated key securely and this is complicated and needs an additional protocol that you may not want.

Otherwise, the key-exchange algorithm is randomized, and re-run will not produce the same key. Better is send a key-lost event, re-execute Diffie-Hellman and re-send the message.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.