secure chat program for Solaris Sun Ray thin clients

I am wanting to know if you have ever found an extremely secure chat program for UNIX (Solaris 7), such that I could control which users can chat with which users, ie John (teacher) can talk to Suzy (student) or Sam (student) and they can talk back to their teacher BUT there is absolutely no way that Suzy can chat with Sam or vice versa. Preferably it would be text-based (not gui although that would be OK) and the systems will have NO access to the internet (a totally standalone network). Hardware is a dual xeon Solaris machine with ~100 Sun Ray thin clients.