
Show HN: Cryptochat, encrypted P2P chat over ICMP - megalodon
https://github.com/mateogianolio/cryptochat
======
rlk
It's a neat idea, but I hope nobody uses it for anything actually sensitive
until the crypto is fixed:

The app uses counter mode encryption with no nonce. In counter mode, the
encryption process uses a stream of pseudo-random bytes generated by
encrypting an incrementing counter with the secret key. The message is then
XORed against this keystream.

For this to be secure, you need the keystream to be different for each
message. Otherwise, if you have multiple messages where the plaintext is XORed
against the same keystream, you can take the XOR of any two ciphertexts, and
you have:

    
    
        C1 ^ C2 = (P1 ^ K) ^ (P2 ^ K)
                = (P1 ^ P2) ^ (K ^ K)
                = (P1 ^ P2) ^ 0
                = P1 ^ P2
    

And now you can break that by statistical techniques, or just trial and error.

(Obligatory crypto challenges link:
[http://cryptopals.com/sets/3/](http://cryptopals.com/sets/3/) )

~~~
megalodon
Thanks for pointing this out.

------
PhantomGremlin
A major problem with using ICMP is that you'll "stand out like a turd in a
punch bowl!" (apologies to the movie Up the Academy).

ICMP is used for a limited number of very specific things. If you appropriate
it for more general use, your traffic will stand out. Look at me! Look at me!
Look at me! If you're using crypto, I think rule #1 should be to blend in, to
_not_ call extra attention to yourself.

I'd rather start my communication by sending a TCP packet to port 443. Just
like billions of TCP sessions start every day. That doesn't help you if
someone is specifically targeting you, but it _might_ keep you from being
noticed initially.

------
luxpir
Nice to see experimentation in this direction.

Another P2P chat project (webRTC this time):
[https://github.com/mehrvarz/rtcchat](https://github.com/mehrvarz/rtcchat)

