One of the common problems of sharing resources over a data communication network is security. Generally sharing information's and resources over a network between a huge number of users is important especially in computer science and engineering field, and this becomes a critical problem for data security. Nowadays many algorithms used for encryption and decryption of data. Cryptography algorithms are divided into symmetric and asymmetric algorithms based on the key used between the sender and receiver of the pieces of information. this paper provides a comparison between symmetric and asymmetric algorithms by using two common algorithms such as AES and RSA. The comparison process focused on the execution time for encrypting and decrypting message of various word length.