Most people would be willing to give up privacy online in exchange for access to services such as Google, Box CEO Aaron Levie told CNBC on Thursday.

Levie's comments on "Closing Bell" were in response to California's sweeping data privacy law, which went into effect Wednesday. Under the legislation, people can ask companies to disclose what personal data they collect and the ways in which they use it.

Users also are allowed to tell companies to delete their data and prevent it from being sold to third-party entities.

Levie said California Consumer Privacy Act does, in theory, have "huge business-model implications" for internet companies who rely on user data to sell advertisements, especially if a similar law were enacted nationwide.

But, in application, he said laws of these sorts probably wouldn't have a major impact on companies, aside from compliance costs.

"I do think actually this is going to cause the ultimate test for consumers, to really make the decision and say, 'Is the value we're getting from these services worth possibly some of the data we're giving up?'" said Levie, whose company provides cloud-based collaboration and file-sharing software.

"And ... generally I think that most consumers will make that trade, because of the fact that these experiences we're getting and the consumer applications we're using do bring a lot of value to our lives."

In fact, Levie said a national privacy law could be a boon to the reputations of technology companies, which have come under scrutiny in recent years over the ways they protect — or do not protect — user data, as well as how they monetize data.

"I think adding that layer of control, that layer of transparency, that layer of visibility is going to be an incredibly important step to rebuilding trust with consumers and ultimately giving them the choice over what happens with their data," he said.

California's Democratic governor, Gavin Newsom, signed the state's data privacy law in October.

A study conducted for the state attorney general's office determined the law could cost companies a total of up to $55 billion in initial compliance costs.

Enforcement of the law, which borrowed some elements from the European Union's data privacy regulation, can begin on July 1.