I have Computer Networking in my course work this semester. Yesterday, I learned about P2P networking. To learn more, I searched the internet and found this article online, published by The Ohio State University.

In this article, they say...

Peer-to-peer networks can be very dangerous from a security perspective. When you join a peer-to-peer network, you are choosing to trust the very large group of strangers that make up the network. Usually you have to open one or more internet “ports” on your computer so that the P2P network can send files to and from your machine. The problem is that you basically cannot control what goes in and out of those ports once you open them. They are like open doors through which you have given the users of the P2P network access to your machine. Sure, there are some limitations to the access other users of the network can have, but, these open ports can become an easy point of entry for attackers trying to gain access to your machine or your network. You might even invite them in without knowing.

When you download a song or an application file from a stranger’s machine, you can never be sure that you are getting what they say you are getting. “Don’t worry about it!” they say, “This is Justin Timberlake’s hottest new track, that’s all!” Maybe that’s true. Maybe you’ll be grooving to JT’s sweet tones as soon as the file downloads. But maybe there is a Trojan Horse hidden inside that file.

From more research, I found out that,

  • You can use SSL to secure the connection (link)
  • P2P network uses Homomorphic Hashing to verify file integrity (link)
  • Data like IP address, username, Operating System version, etc. might leak (link)

So, my questions are,

  • Is P2P network not secure? Because as far as I know, it is used in Blockchain technology.
  • Is it possible to exploit the network in such a way that you can inject malware in the files that you share via P2P?
  • When compared to the centralized Client-Server networking, which one is more secure for sharing encrypted files? Because servers can also be (and have been) hacked.

What I mean by the last question is, for a complete naive user, who doesn't know how to check MD5 hashes, which one will be more secure? P2P where anyone can share files, or dedicated servers that are resilient but not immune to hacking.

  • Your last question is too vague and undefined to answer. Can you rephrase it?
    – schroeder
    Commented Feb 18, 2022 at 10:25
  • Also, welcome to information security! This is a tough but very rewarding field with many directions to take one's career. I offer this one tip that will help you out from day one in security: always ask "secure from what?" There is no "Security", there are only a set and stack of controls that protect against various threats. SSL, hashing, file integrity, etc. protect against specific things.
    – schroeder
    Commented Feb 18, 2022 at 10:35
  • You're right, I did confuse hashing with encryption. Sorry about that. "Secure from what?" Secure from bad files being transmitted from seemingly genuine site. E.g. I download an ISO directly from "archlinux.org" and I download a torrent file for the same ISO. Which one is more secure, in the sense that the final ISO file I receive is the good file. When not checked against MD5/sha256 hash.
    – heikrana
    Commented Feb 19, 2022 at 15:24
  • You can confirm the source if from a single server. I'm not sure that I'd classify that as "more secure", simply "more verifiable". And then you have to factor in the idea that an official site can link to the official torrent file, and, as you point out, the P2P network ensures, through hashing, that you are getting the right files and file parts. So, with that example, you are comparing aples and organes.
    – schroeder
    Commented Feb 19, 2022 at 15:38

2 Answers 2

  • SSL protects the transmission from 3rd parties, but does nothing to protect you from the hosts you connect to
  • File integrity only matters if you are comparing the file to a known-good file. If the file is already bad, integrity won't protect you from that.
  • The type of P2P described in the article is about file-sharing networks: "A P2P network is a group of computers on the internet that have agreed to share files with one another. "
  • A 3rd party will find it very difficult to inject malicious files into a stream, however that isn't required at all. All a malicious 3rd party would need to do is simply join the network and serve the malicious file directly ... no 'hacking' required when people just accept the virus...
  • In your last point, you said that one can serve the malicious file directly. A file is broken into pieces, so can someone share malicious pieces to a person who was downloading a good file? Aren't these pieces checked with the same hashing technique?
    – heikrana
    Commented Feb 19, 2022 at 11:27
  • You are assuming that there is only one file in the network and that the file is good. I can take a good file, infect it, and host it on the network. Yes, it will be different and have a different ID than all the other files. But I can make my malicious file attractive and thereby get more and more seeders. I could say that my file has something the others don't, or be of better quality, or whatever. In the past, there were malicious files that had many times more seeders than the official "good" files.
    – schroeder
    Commented Feb 19, 2022 at 13:09
  • Okay, I understood that. And this is true for both Client-Server and P2P network, right? Someone can publish a malicious file on their server advertising as better software.
    – heikrana
    Commented Feb 19, 2022 at 15:32
  • That's right. But it's easier to confirm the source.
    – schroeder
    Commented Feb 19, 2022 at 15:36
  • What if the network is structured so that some of the peers also check each file for viruses?
    – moonman239
    Commented Jan 6 at 20:15

There is a lot to unpack here. With regard to the article that you referenced - it seems to be focused on p2p file sharing networks (note it references Napster, Kazaa, etc. in the first sentence). Yes, it is true that files downloaded through these networks could very well be malicious. But, the same is true when you download a file through any network, without taking precautions.

This is why the concept of integrity is so important. If I trust Sam, and Sam tells me, "you can download The Beatles' White Album from ornvyr's server, at https://www.ornvyr.com/beatleswhitealbum.zip, and the SHA256 hash of the file that you download should be 06c0919670570fdce1a66207059c98d7554e4b924dcdc0a7979cfd271da05acf" - then I can safely download the file from your server, even if I don't trust you or your server, as long as I verify that the hash of the file that I downloaded matches what Sam told me it should be, before I open or execute the file. And, this applies regardless of what type of network the file is transferred through (e.g. p2p, client-server, etc). The same type of integrity verification can be done using a digital signature instead of a hash - i.e. if Sam signs the file using his private key, and I have Sam's public key, then I can verify Sam's signature on the file using his public key after I download it from your server.

This is actually quite common in the open source world, where distribution ISO's are often hosted on untrusted mirror servers. For example, see https://tails.boum.org/contribute/design/download_verification/.

With regard to blockchain technology - yes, it is true that blockchain technology relies on p2p networks. But, these networks are not used for file sharing (like Napster, etc. were) - they are used to transfer blocks of data which represent transactions. The data must follow a prescribed format, and there is built-in integrity checking based on a 'difficulty requirement' (see https://en.bitcoinwiki.org/wiki/Difficulty_in_Mining for more info) that enables each node to verify that the data it received from another node is true and correct. If a rogue node tries to send bogus data to other nodes, it will immediately be detected by the other nodes, and the other nodes will soon block the rogue node.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .