Senators John Kerry and John McCain introduced a tough new privacy bill on Tuesday that would require companies to give clear notice when consumers' data is being collected and to keep it safe from hackers.

Companies collecting data must also allow consumers to opt-out of some data collection, and must agree, or opt in, to any collection of sensitive data that would identify them.

The bill would also press businesses to only collect the information they need for any particular transaction.

Kerry, a Democrat from Massachusetts, said it had support from some big tech companies.

These companies agree with us that it doesn't just make good business sense to protect their customer; they know it's the right thing to do, said Kerry at a press conference.

McCain, an Arizona Republican, noted that many web sites -- like most search engines -- are free precisely because they are supported by advertising.

Our bill seeks to respect the ability of businesses to advertise while also protecting consumers' personal information, said McCain.

(Reporting by Diane Bartz, editing by Gerald E. McCormick)