Generate session key on both sides

This should wrap up the authentication.  It's messy, but works.
This sometimes crashes...likely because of random nonces and
encrypted messages possibly containing new lines in unexpected
places. That should probably be fixed.