通过ICMP实现加密的P2P聊天:cryptochat
ygp8
9年前
加密的(查看cryption.js,当前使用 crypto 模块的AES-256-CTR) P2P加密基于ICMP 使用 ping 请求。
$ sudo cryptochat <ip> <encryption_key>
If it doesn't work, it is probably because either your computer or your router is somehow blocking external ICMP requests.
Install
Make sure you have node0.10.x(tip: use n) and then install the package globally withsudo.
sudo npm install -g cryptochat
ICMP Echo request format
bits 0-7 | bits 8-15 | bits 16-31 |
type = 0 | code = 0 | header checksum |
identifier | sequence number | |
payload |
The message data is attached as the ICMP payload.
Message
Messages are piped fromstdinand split into payload packages, which are encrypted separately and sent as ICMP Echo requests.
bits 0-15 | bits 16-31 | |
identifier =0x6363 | message length | |
message |
An "end" request is sent in order for the receiver to know when a message is completed. The end request has the following format:
bits 0-15 | bits 16-31 | |
0x6363 | 0x0010 | |
0xffffffffffffffff |
When the end request is received, the full message is decrypted and printed to the screen.
Contribute
As always, contributions are much appreciated.