Logged DH protocol, encryption process and decryption process.