You're generally not even allowed to discuss your salary with your colleagues after (if) you're hired by one of those potential employers.
If it's confidential after that, it should be confidential before, too.
If it's confidential after that, it should be confidential before, too.
http://www.npr.org/2014/04/13/301989789/pay-secrecy-policies...
Discussing your salary is always, ALWAYS legal.
ALWAYS.
It's also moral and ethical. It's the cornerstone of collective action. It is information that can NEVER hurt either you or your coworker, because someone is going to have to justify a salary in one direction or another as a result. Never, ever hesitate to share your salary information with anyone who wants to know.
Ashamed that it's too high? Work to get your coworkers raises. Ashamed that it's too low? Time to open negotiations, either with your current employer or another one.