Implement Protocol Encryption (PE/MSE)

Author: transitive-bullshitCreated May 29, 2014Updated Jan 27, 2026
Labelsenhancementhelp wantedarea/browserarea/nodeaccepted

Protocol encryption (PE) aka message stream encryption (MSE) is a bittorrent extension to enhance privacy and confidentiality, effectively making bittorrent traffic harder to identify and throttle by ISPs.

Note that there is no official BEP describing protocol encryption, but it is widely supported by all the top clients.

At a high level, there are two different levels of bittorrent encryption that exist, namely those which only encrypt bittorent headers, and stronger encryption such as RC4 which encrypts the entire stream. I'm guessing that webtorrent will want to eventually support both, but I'd recommend implementing the header-level encryption first since webtorrent is already heavily burdened by all the SHA1 hashes going on.

bittorrent-clients should accept encryption options similar to those described here; e.g., encrypted connections should be either disabled, enabled and optional (e.g. prefer encryption but fallback to unencrypted if the remote peer doesn't support encryption), or enabled and forced (e.g., only connect to peers supporting encryption).

Resources: