In recent years, network security has become an important issue. Encryption has come up as a solution, and plays an important role in information security system. Many techniques are needed to protect the shared data. The present paper focus on cryptography to secure the data while transmitting in the network. Firstly, the data which is to be transmitted from sender to receiver in the network must be encrypted using the encryption algorithm in cryptography. Secondly, by using decryption technique the receiver can view the original data. In this paper, the authors implemented a simple algorithm for both encryption and decryption.