Protecting information systems from manipulation and unauthorized access is extremely important. The Diffie-Hellman (DH) protocol is essential for key exchange because it is based on the discrete logarithm problem. Although widely used, this protocol is vulnerable to various attacks like man-in-the-middle, replay, and brute force due to its lack of validation mechanisms for authorized parties. The novel proposed algorithm treats these vulnerabilities and enhances the security of the DH scheme by performing authentication between the two parties based on the complete graph. We have used simple mathematical operations to ease implementation. The proposed work enhances the security of the DH algorithm by using the properties of the complete graph containing n vertices and edges. These edges are used with a pair of passwords to construct combined public keys from the public keys of the sender and receiver, respectively. These combined keys ensure that only authorized parties can decrypt the message and accurately reconstruct the graph. The proposed algorithm provides strong security enhancement to the traditional DH protocol during keys exchange and prevents tampering.