The Diffie-Hellman algorithm, developed in 1976 by Whitfield Diffie and Martin Hellman, enables two parties to generate a shared cryptographic key for secure communication over an insecure channel without transferring the key itself. The process involves agreeing on a prime number and a primitive root, where each party computes their public key using a secret key and shares it to compute a final shared secret key. While this method allows secure key sharing and communication, it is slower and requires more processing power compared to symmetric encryption.