  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.
