I am currently working on an anonymous P2P file sharing application and I am elaborating some already existing solutions. Some of them allegedly provide point-to-point encryption using RSA public/private keys to exchange a symmetric secret key, which is then used to encrypt a stream of data.
But I wonder how is it possible for two peers to safely exchange their public keys with each other without any third party (without any Certificate authority providing those public keys) and at the same time without being able to become attacked with "Man-in-the-middle" technique? (Actually some of them allow exporting generated public keys and exchange them in a "secure" way like personal meeting, phone, e-mail. But most of these P2P solutions communicate only over the wire. )
By point-to-point I mean connection between two peers, who are directly connected nodes in an P2P overlay, but can be more than one hops away from each other in a physical network.