5th Generation (5G) mobile networks are gradually being used all over the world. However, channel-coding security has become one of the most important challenges, especially in the face of new attacks such as side-channel attacks. To protect 5G against side-channel attacks, the multiplicative masking method for low-density parity check code (LDPC) codes is exploited in this study. First, a multiplication algorithm in finite fields is proposed for LDPC codes. Second, to secure LDPC codes, a multiplicative masking method based on a multiplication algorithm is put forward. Third, based on the multiplicative masking method, a secure coding method of LDPC for 5G is advanced. Based on the above designs and other improvements, the security of 5G networks is improved owing to the randomization of the channel-coding process and protection of important information against side-channel attacks.