Yahalom

Alice and Bob share a secret key with Trent.

AliceTrentBobno encryption yetconcat my name + random numbersend (unencrypted)concat Alice's name + Alice's random number + my own random numberencrypt with key shared with Trentsend (encrypted)Create M1:Bob's name + random session key + Alice's random number + Bob's random number.Encrypt with Alice's key.Create M2:Alice's name + random session key + Alice's random number + Bob's random number.Encrypt with Bob's key.send M1 and M2decrypt M1, extract session key, confirm random number matches.send M2send Bob's random numberencrypted with session keyextracts session keyconfirms his random numberAliceTrentBob

Thanks! You can always email me or use contact form for more questions/comments etc.