A resource obtaining method, wherein the method comprises: receiving, by a first node, a first data packet from one second node or first data packets from more second nodes, wherein the one or more first data packets are obtained after a resource piece of a target resource is encrypted by using a public key in a key pair, the key pair is used to encrypt the target resource between the first node and the one or more second nodes in a peer-to-peer, P2P, network, and the key pair comprises the public key and a private key; decrypting, by the first node, the one or more first data packets by using the private key, to obtain one or more resource pieces of the target resource; and determining, by the first node, the target resource based on the one or more resource pieces; wherein the method further comprises obtaining, by the first node, a key pair uniquely corresponding to the target resource, wherein the obtaining, by the first node, a key pair uniquely corresponding to the target resource comprises: receiving, by the first node, the key pair uniquely corresponding to the target resource from a tracking node in the P2P network, wherein the key pair uniquely corresponding to the target resource is prestored in the tracking node; or receiving, by the first node, a digital certificate of a tracking node in the P2P network, wherein the digital certificate carries an identifier of the target resource; and generating, by the first node, a key pair based on the digital certificate, wherein the digital certificate of the tracking node corresponding to the target resource in the P2P network is prestored in the tracking node; wherein before the receiving, by a first node, a first data packet from one second node or first data packets from more second nodes, the method further comprises: sending, by the first node, token data of an authentication node to the one or more second nodes, wherein the token data is used to indicate that the first node has a permission to obtain the target resource. receiving, by a first node, a first data packet from one second node or first data packets from more second nodes, wherein the one or more first data packets are obtained after a resource piece of a target resource is encrypted by using a public key in a key pair, the key pair is used to encrypt the target resource between the first node and the one or more second nodes in a peer-to-peer, P2P, network, and the key pair comprises the public key and a private key; decrypting, by the first node, the one or more first data packets by using the private key, to obtain one or more resource pieces of the target resource; and determining, by the first node, the target resource based on the one or more resource pieces; wherein the method further comprises obtaining, by the first node, a key pair uniquely corresponding to the target resource, wherein the obtaining, by the first node, a key pair uniquely corresponding to the target resource comprises: receiving, by the first node, the key pair uniquely corresponding to the target resource from a tracking node in the P2P network, wherein the key pair uniquely corresponding to the target resource is prestored in the tracking node; or receiving, by the first node, a digital certificate of a tracking node in the P2P network, wherein the digital certificate carries an identifier of the target resource; and generating, by the first node, a key pair based on the digital certificate, wherein the digital certificate of the tracking node corresponding to the target resource in the P2P network is prestored in the tracking node; wherein before the receiving, by a first node, a first data packet from one second node or first data packets from more second nodes, the method further comprises: sending, by the first node, token data of an authentication node to the one or more second nodes, wherein the token data is used to indicate that the first node has a permission to obtain the target resource. receiving, by the first node, the key pair uniquely corresponding to the target resource from a tracking node in the P2P network, wherein the key pair uniquely corresponding to the target resource is prestored in the tracking node; or receiving, by the first node, a digital certificate of a tracking node in the P2P network, wherein the digital certificate carries an identifier of the target resource; and generating, by the first node, a key pair based on the digital certificate, wherein the digital certificate of the tracking node corresponding to the target resource in the P2P network is prestored in the tracking node; wherein before the receiving, by a first node, a first data packet from one second node or first data packets from more second nodes, the method further comprises: sending, by the first node, token data of an authentication node to the one or more second nodes, wherein the token data is used to indicate that the first node has a permission to obtain the target resource.