You might be interested in PGP communication: http://www.pitt.edu/~poole/PGP.htm
Both of you would generate a public key-private key pair on your local systems. Each key pair is mathematically related, that is, a public key is related to its private key. You would then publish the public key, well, publicly for everyone to see. The idea is anyone can encrypt a simple plaintext message using your public key and send you the result. Only you would be able to decrypt the message using your stored private key.
So in this case, Alice would tell Bob their public key, in the chatroom or somewhere else. Bob then uses Alice's public key to encrypt a secret plaintext message, then posts the result on the chat service. Alice grabs the encrypted message from the chat server and decrypts it at their local machine using the secret private key. Similarly, communications from Alice to Bob are also encrypted using Bob's public key.
The steps involved in generating a public key-private key pair are listed here: http://www.seas.upenn.edu/cets/answers/pgp_keys.html