arXiv:2609.17397cs.CRSep 2026

Manuscript Offprint

arXiv:2609.17397

Closing the Loop: Bidirectional Fully Encrypted Protocols

Baigang Chen, Nicholas Hopper

Baigang Chen

University of Minnesota

chen9464@umn.edu

Nicholas Hopper

University of Minnesota

hoppernj@umn.edu

Abstract—Fully encrypted protocols (FEPs) provide encrypted channels that make all protocol-generated bytes computationally indistinguishable from uniform random strings. Several previous works have explored security definitions and constructions of unidirectional FEPs: protocols in which one party acts only as a sender, and the other acts only as a receiver. However, most applications require two-way information exchange, and a network adversary can observe communication in both directions and their shared lifetime. Because the semantics of bidirectional channels involve more complex shared state, it is possible that the “naïve” composition of two unidirectional channels can result in a two-way protocol that can be detected based on dependencies between the two directions, such as traffic imbalance, channel closure, failures, or connection tear-down.

To address this issue, we introduce new formal security definitions for bidirectional FEPs that capture exact shaping, delivery, protocol-state integrity, private half-close, and cross-direction isolation, while revealing a public “sending schedule” and “closing epoch” that may be randomized. We show that the trivial composition fails to meet these definitions, leading to practical detection attacks. We then construct provably secure bidirectional FEPs (BiFEPs) for both the datastream and datagram settings. For datastream, we combine two direction-separated FEPs with a “wrapper” layer that prevents detection based on the mismatch between uni- and bi-directional connection states. For datagram, we add encrypted DATA/FIN/ACK with replay protection and loss-tolerant close. We validate the design through a Rust implementation and show that none of the surveyed deployed protocols provides the full set of BiFEP security properties.

I. INTRODUCTION

Encryption hides message contents, but not necessarily the protocol carrying them. For instance, TLS and QUIC retain recognizable handshakes and other structured features that contribute to a protocol's observable wire fingerprint [1]–[3]. An observer can use this fingerprint to classify, throttle, or block traffic without decrypting it. Obfuscated transports such as obfs4 and Shadowsocks seek to remove fixed protocol markers by making all protocol-controlled bytes appear random [4], [5]. Random-looking bytes alone, however, do not make a connection unidentifiable: message lengths, timing, and responses to active probes can remain distinctive, and some censors specifically target high-entropy traffic [6], [7]. Protocol mimicry is likewise fragile when its imitation differs detectably from the target protocol [8]. These limitations motivate a precise separation between cryptographically hiding protocol-generated bytes and controlling the metadata that remains visible.

Fenske and Johnson formalized this goal with fully encrypted protocols (FEPs), which make protocol-generated bytes indistinguishable from uniform strings of the same public length [9]. Their definitions, however, model only one direction at a time. Two secure FEPs run in parallel can therefore leak session structure through their interaction. In a request-response exchange, for example, a naïve composition may cause the request direction to go silent when the requester half-closes while the response direction remains active, exposing that private event although every transmitted byte looks random. Cross-direction reactions can similarly enable active probes. We formalize and measure this gap (§III-D, §VIII-G), motivating a single bidirectional security object that jointly governs shaping, failure, and close behavior.

We construct bidirectional FEPs (BiFEPs) for both data-streams and datagrams. The core difficulty in recognizing this extension is allowing the connection to close without revealing the private events that made it ready to close. If an authenticated FIN or a decryption failure immediately closes the transport, an observer learns when the private protocol state changed. An active adversary can also use this response as a probe. A protocol that never closes avoids this leakage but is not practical. Our datastream construction separates private close readiness from the public close time. Each endpoint continues the public traffic schedule after a half-close, and the transport closes only at the next epoch in a public schedule. The observer learns a quantized close time, but not the exact time of the private close event. This design treats termination as part of the secure channel [10].

Datagrams require a separate construction because UDP may lose, reorder, or duplicate packets [11]. A datastream FIN is drained once its ciphertext prefix leaves the sender, but a transmitted datagram may never arrive. Treating transmission as delivery could therefore cause the two endpoints to reach inconsistent close states. Our datagram construction places encrypted FIN and ACK bits inside authenticated, scheduled datagrams. It retransmits these control bits idempotently and

Network and Distributed System Security (NDSS) Symposium 2027

22–26 March 2027, Seoul, Republic of Korea

ISBN 978-1-970672-09-1

https://dx.doi.org/10.14722/ndss.2027.240467

www.ndss-symposium.org requires authenticated evidence from both directions before closing. After becoming ready to close, an endpoint remains live through a public number of additional close buckets and retransmits its acknowledgment. A later ACK-bearing datagram can therefore repair an isolated loss. Packet loss may prevent termination, but it cannot create false close readiness.

Contributions.

• Security framework and proofs. We formalize new security conditions for the bidirectional case, including correctness, traffic shaping, passive and active security, protocol-state integrity, and private close. We show that trivial composition of two uni-directional FEPs does not satisfy these security goals.

• Bidirectional constructions. We construct BiFEPs for both datastreams and datagrams, providing exact per-direction traffic schedules and encrypted close coordination tailored to each transport model. We prove both constructions secure while exposing only the public schedule and quantized close epochs.

• Implementation and evaluation. We implement both constructions in Rust and evaluate their behavior under active modification, replay, loss, and timing variation. We also compare TLS 1.3 [1], QUIC v1 [2], [3], [12], WireGuard [13], Shadowsocks 2022 [5], obfs4 [4], and Tor [14] at the specification level. None provides all bidirectional FEP properties. We further quantify the costs and practical constraints of cover traffic.

References (38)