dominictarr / pull-box-stream

One way streaming encryption based on libsodium's secretbox primitive
MIT License
84 stars 10 forks source link

Forward Secrecy / Replay Attacks #4

Closed Tethik closed 9 years ago

Tethik commented 9 years ago

I stumbled across this repo via a friend. I'm a student so hope you forgive misunderstandings, but I'm curious.

First, what protection is there against a compromised key. Couldn't an eavesdropper just decrypt all captured traffic once the key is leaked from any of the hosts? In addition it seems like it would be a pain to renew the key if you want to distribute this over a large amount of machines.

Second, what happens when e.g. the sink is forcibly reset via DoS. Does the nonce reset back to its initial value? If so it seems like it could lead to replay attacks, if you have that initial traffic.

dominictarr commented 9 years ago

This protocol is streaming, but only one way. You could use it to encrypt a file, but not a tcp connection. It's not a replacement for tls, it needs to be used in conjuction with a handshake protocol to derive a forward secure shared key.

Someone posted it on hacker news... but it's not fully ready yet.

dominictarr commented 9 years ago

If an attacker tampered with the stream the intrusion would be detected but the protocol would error and another connection would need to be established. This is a problem with tcp anyway, because an attacker can easily send a reset packet.

However, tcp connections can drop anyway, so the higher level protocols need to be designed to recover from failed connections, thus recovering from a tampered message is not within the scope of this protocol - just detection.

Tethik commented 9 years ago

Ok. That makes sense. Assuming there is a key exchange protocol at the start then it makes more sense. Thanks!