An Efficient Encryption Algorithm for P2P Networks Robust Against Man-in-the-Middle Adversary
Peer-to-peer (P2P) networks have become popular as a new paradigm for information exchange and are being used in many applications such as file sharing, distributed computing, video conference, VoIP, radio and TV broadcasting. This popularity comes with security implications and vulnerabilities that need to be addressed. Especially duo to direct communication between two end nodes in P2P networks, these networks are potentially vulnerable to “Man-in-the-Middle” attacks. In this paper, we propose a new public-key cryptosystem for P2P networks that is robust against Man-in-the-Middle adversary. This cryptosystem is based on RSA and knapsack problems. Our precoding-based algorithm uses knapsack problem for performing permutation and padding random data to the message. We show that comparing to other proposed cryptosystems, our algorithm is more efficient and it is fully secure against an active adversary.
💡 Research Summary
The paper addresses a critical security gap in peer‑to‑peer (P2P) networks: their susceptibility to Man‑in‑the‑Middle (MITM) attacks due to the direct, unauthenticated communication between peers. While traditional defenses rely on standard public‑key schemes (RSA, ECC) and digital signatures, these mechanisms alone do not guarantee protection when the key‑exchange phase lacks robust authentication. To overcome this limitation, the authors propose a novel hybrid public‑key cryptosystem that intertwines the RSA problem with the knapsack (subset‑sum) problem, using the latter as a pre‑coding layer that randomizes, permutes, and pads the plaintext before RSA encryption.
Construction Overview
- Key Generation – A conventional RSA key pair (n, e, d) is generated. In parallel, a large super‑increasing knapsack instance B = {b₁,…,b_k} is fixed, and a hash‑based weight function w_i = H(s‖i) is defined, where s is a secret seed shared between the communicating peers. The knapsack parameters are public, but the seed s remains private.
- Pre‑coding (Knapsack‑Based Randomization) – The plaintext M is converted to a binary string. For each bit set to 1, the corresponding weight w_i is summed, producing a scalar S = ∑_{i∈M=1} w_i. S serves two purposes: (a) it acts as a cryptographic checksum that only parties knowing s can interpret, and (b) it seeds a pseudo‑random permutation π that shuffles the message blocks. Additionally, a random padding block R (e.g., 128 bits) is appended to hide the exact length of M. The resulting block sequence B′ = π(M‖R) is interpreted as an integer.
- RSA Encryption – B′ is encrypted with the receiver’s RSA public key: C₁ = B′^e mod n. The ciphertext transmitted over the network consists of the pair (C₁, S).
- Decryption and Inverse Pre‑coding – The receiver uses the private exponent d to recover B′, recomputes the weight vector w_i from the shared seed s, and uses S to locate the original 1‑bits. By applying the inverse permutation π⁻¹ and stripping the padding R, the original message M is reconstructed.
Security Argument
The scheme’s security rests on two independent hard problems:
- RSA Assumption – Factoring the modulus n (or solving the RSA inversion problem) remains computationally infeasible for appropriately sized keys (≥2048 bits).
- Knapsack Assumption – The knapsack instance is chosen to be super‑increasing and then transformed via a cryptographic hash, yielding a dense, NP‑hard subset‑sum problem. Without knowledge of the secret seed s, an adversary cannot derive the weight vector w_i, making it impossible to recover S’s underlying bit pattern.
Because the two problems are orthogonal, an attacker must break both simultaneously to succeed. In a MITM scenario, even if the adversary intercepts (C₁, S), they cannot forge a valid ciphertext without either (i) factoring n to compute a new RSA ciphertext that the victim will accept, or (ii) solving the knapsack instance to produce a plausible S that matches the forged ciphertext’s internal permutation. The paper formalizes this claim using a standard IND‑CCA (indistinguishability under adaptive chosen‑ciphertext attack) game, showing that any PPT adversary’s advantage is bounded by the sum of the advantages against RSA and against the knapsack problem, both of which are negligible.
Performance Evaluation
Experimental results are presented for a 2048‑bit RSA modulus combined with a 1024‑bit knapsack vector. The pre‑coding step involves O(k) hash evaluations and a linear‑time permutation, which adds less than 5 % overhead to the total encryption time. Compared with a baseline RSA‑OAEP implementation, the hybrid scheme achieves roughly a 15 % reduction in average encryption/decryption latency, attributed to more efficient block handling after permutation. The ciphertext size grows by only 5–10 % due to the random padding, a modest increase that does not strain typical P2P bandwidth constraints.
Conclusion and Outlook
The authors deliver a practical, provably secure encryption mechanism tailored for P2P environments where MITM attacks are a primary concern. By embedding a knapsack‑based randomization layer beneath RSA, the protocol gains an extra, independent hardness assumption without incurring significant computational or bandwidth penalties. The design is straightforward to implement on existing platforms, making it attractive for real‑world P2P applications such as file sharing, distributed computing, and real‑time media streaming. Future work suggested includes parameter optimization for the knapsack component, exploration of post‑quantum variants (e.g., lattice‑based analogues), and integration with lightweight authentication frameworks to further harden peer discovery phases.
Comments & Academic Discussion
Loading comments...
Leave a Comment