Communication is the important part in any type of network for making it possible to transfer data from one node to  another.  Communication  needs  quality and  security  for  better  performance and  for acceptance of users and client companies. Quality is dependent on size and some other factors of network but security is very concern parameter in network as it is   independent   of   network   size   and   complexity. Security has become more important to personal computer users, organizations, and the military. Security became a major concern with the advent of internet  and  the history of  security  allows  a  better understanding  of  the  emergence  of  security technology. The internet structure itself allowed  for many security threats to occur. The modified architecture of the internet  can reduce the possible attacks that can be sent across the network. Knowing the attack methods, allows for the appropriate security to emerge. Data integrity is quite a issue in security and to maintain that integrity we tends to improve as to   provides   the   better   encryption   processes   for security. In our proposed work we provide harder encryption with enhanced public key encryption protocol for security and proposed work can be implemented   into   any  network  to   provide  better security. We have enhanced the hardness in security by improving the Diffie-Hellman encryption algorithm by adding some more security codes in current algorithm.