In this paper, the radio frequency energy harvesting (EH) and security issues in Internet of Things (IoT) sensor networks with multiple untrusted relays are considered. In particular, the communication protocol is divided into two phases. The first phase is used for EH, in which the IoT sensor nodes (SNs) and relays harvest energy from multiple power transfer stations. The second phase is used for information transmission in two steps: 1) the selected SN uses the harvested energy to broadcast information to the controller and the relays, and 2) the selected relay forwards information to the controller by applying the amplify-and-forward protocol to improve the quality of the communication between the SN and the controller. During information transmission, the controller is at risk of losing information because the relay may act as an eavesdropper (namely, an untrusted relay). Thus, to improve the secrecy performance of the considered system, we propose an optimal scheme, namely, best-sensor-best-untrusted-relay (BSBR) and compare this scheme with random-sensor-random-untrusted-relay and a threshold-based scheme. The closed-form expressions for the secrecy outage probability (SOP) and secrecy throughput (ST) are obtained and verified through Monte Carlo simulations to confirm the superior performance of our approach. EH time optimization and the target secrecy rate optimization algorithms are also proposed. In addition, the impacts of the EH time, the EH efficiency coefficient, the numbers of SNs and untrusted relays, and the target secrecy rate on the SOP and the ST are investigated. The results indicate that the BSBR generally outperforms the two baseline schemes in terms of the SOP and ST.