As 5G networks become more widespread, securing data transmission is increasingly crucial. This paper provides a comparative analysis of cryptographic algorithms in the context of 5G, focusing on security, computational efficiency, and resilience to attacks. The study evaluates the effectiveness of popular encryption algorithms, such as AES, RSA, and ECC, under the unique constraints of 5G. Results demonstrate which algorithms offer the best balance of security and performance, presenting insights that can guide future implementations of secure 5G networks.