The Internet of Things (IoT) has a significant demand in society due to its features, and it is constantly improving. In the context of wireless technology, Ultra-reliable and low-latency communication (URLLC) is one of the essential and challenging services in fifth-generation (5G) networks and beyond. The research on URLLC is still in its early stages due to its conflicting requirements, regarding high reliability and low latency. In this paper, we study the performance of secure short-packet communications and resource allocation in IoT systems. To this end, we investigate a health center automation, where the goal of the access point is to send critical messages to devices without eavesdropping. In this context, our goal is to maximize the weighted sum throughput and minimize the total transmit power, respectively. The problems of maximizing the weighted sum throughput, and minimizing the total transmit power are non-convex and hard to solve. To overcome this challenge, we use efficient mathematical techniques, such as the block coordinate descent (BCD) method and gradient ascent algorithm; we also use estimation methods such as Ralston, Heun, and forward-backward, in the derivative part of the gradient ascent algorithm. The simulation results show the performance advantages of the BCD algorithm and the gradient ascent in the short packet transmission scheme, also the simulation results show the superiority of the proposed methods in most cases.