Is it illegal for your employer to tell anyone your salary except for the government?

I think it is illegal. I checked some twenty or so web sites, and found the United States Department of Labor does surveys annually and quarterly. In this they gather information on location wages and salaries and occupation. Yet, you cannot get any information through them on an individual because it is labeled "confidential." I can find out your annual income from open records, like a credit file, or a bank loan application where you provided it as a part of the application process. In other words, it is easy to get information about income. I know of no law that prohibits the employer from revealing. I can think of reasons some employers would not want to.