This paper analyzes the time performance of RSA and ElGamal public-key cryptosystems, highlighting that RSA is faster in both encryption and decryption processes compared to ElGamal. The study emphasizes the importance of cryptography for data security in computer and network systems and presents comparative results for different file types. Ultimately, it concludes that RSA is more suitable for applications requiring high performance while maintaining security.