Sixth generation (6G) wireless networks are a promising technology for meeting the extreme demands of 2030 of high data rates, ultra-low latency, and ultra-reliability. However, supporting the services of 6G networks requires advanced security mechanisms. In addition, 6G has a rapid and simple means of accessing the channel because of its broadcast transmission method, which makes it prone to eavesdropping attacks. Physical-layer security (PLS) is predicted to be a suitable method of achieving network security, in which the characteristics and advantages of wireless networks are exploited. PLS technologies include wiretap code designs, artificial noise injection (jamming), multi-input multi-output (MIMO)(beamforming), and physical-layer authentication. This paper proposes an erasure corrector code, namely a low-density parity check (LDPC), and ultra-massive MIMO (UMMIMO) to fix this issue. The simulation results show that our solution guarantees data secrecy, even against eavesdroppers with many antennas and considerable decoding resources, while reducing power consumption, consequently supporting secure, green transmission.