Smart manufacturing is pivotal in the context of Industry 4.0, as it integrates advanced technologies like the Internet of Things (IoT) and automation to streamline production processes and improve product quality, paving the way for a competitive industrial landscape. Machines have become network-based through the IoT, where integrated and collaborated manufacturing system responds in real time to meet demand fluctuations for personalized customization. Within the network-based manufacturing system (NBMS), mobile industrial robots (MiRs) are vital in increasing operational efficiency, adaptability, and productivity. However, with the advent of IoT-enabled manufacturing systems, security has become a serious challenge because of the communication of various devices acting as mobile nodes. This paper proposes the framework for a newly personalized customization factory, considering all the advanced technologies and tools used throughout the production process. To encounter the security concern, an IoT-enabled NBMS is selected as the system model to tackle a black hole attack (BHA) using the NTRUEncrypt cryptography and the ad hoc on-demand distance-vector (AODV) routing protocol. NTRUEncrypt performs encryption and decryption while sending and receiving messages. The proposed technique is simulated by network simulator NS-2.35, and its performance is evaluated for different network environments, such as a healthy network, a malicious network, and an NTRUEncrypt-secured network based on different evaluation metrics, including throughput, goodput, end-to-end delay, and packet delivery ratio. The results show that the proposed scheme performs safely in the presence of a malicious node. The implications of this study are beneficial for manufacturing industries looking to embrace IoT-enabled subtractive and additive manufacturing facilitated by mobile industrial robots. Implementation of the proposed scheme ensures operational efficiency, enables personalized customization, and protects confidential data and communication in the manufacturing ecosystem.