1. Alice generates a random number x and computes and sends the exponential gx to Bob.
2. Bob generates a random number y and computes the exponential gy.
3. Bob computes the shared secret key K = (gx)y.
4. Bob concatenates the exponentials (gy, gx) (order is important), signs them using his asymmetric key B, and then encrypts them with K. He sends the ciphertext along with his own exponential gy to Alice.
5. Alice computes the shared secret key K = (gy)x.
6. Alice decrypts and verifies Bob's signature.
7. Alice concatenates the exponentials (gx, gy) (order is important), signs them using her asymmetric key A, and then encrypts them with K. She sends the ciphertext to Bob.
8. Bob decrypts and verifies Alice's signature.