There’s a paradoxical market trend evolving at retail that is making the e-commerce space particularly challenging. How do retailers balance a need to mine data from consumers (who are increasingly more willing to shop online and give up their personal information) while preventing cyber attacks that can compromise the privacy of shoppers?

It’s not an easy question to answer, but one thing is clear: As the number of online sales increases, so are cyber attacks.

According to the PricewaterhouseCoopers the number of cyber attacks jumped 48 percent in 2014 while the Ponemon Institute said in a separate report that the average cost of a “cyber crime” on U.S. retailers doubled to $8.6 million per company from 2013 to 2014. And according to another report by Hewlett Packard Enterprise Security and the Ponemon Institute, the bulk of these average costs are garnered by information loss (about 38 percent) and business disruption (39 percent).

Meanwhile, eMarketer said in a separate report that it expects business-to-consumer global online sales to increase from about $1.2 trillion today to over $2.4 trillion in 2018. At the same time, consumers cite “online shopping” as the second most activity (behind financial transactions) to elicit privacy concerns, according to a survey from Harris Interactive.

These trends come at a time when the retail industry is stepping-up efforts to evolve how they interface with consumers – online and in stores as well. And the consumer is demanding an in-store experience that includes convergence of traditional distribution into an omnichannel experience.

Bridget Johns, the head of customer success at RetailNext, said there’s no question that “retailers have ‘gotten the memo’ about the shopper-driven demand to connect the dots and quickly and more effectively converge the various channels into one seamless experience, and there are ways to do that through technology and consolidate data into one platform.”

All of which has to be done in a safe, consumer-driven way. Johns said that a “big challenge remains in that any interaction that directly touches a consumer must be done on her terms, with her permission, and in a thoughtful manner. Retailers still haven’t figured this challenge out adequately.”

Johns said retailers are working on a variety of technologies in this area such as “beacons” and other mobile technology, “but taking those communication and data gathering streams and connecting the entire consumer shopping journey is just not happening en masse – yet.”

Then again, maybe that’s a good thing given the increasing number of cyber attacks in the market. The list of retail data breeches last year is staggering. The companies attacked include Target, Neiman Marcus, Michaels, Aaron Brothers, eBay, Home Depot and SuperValu. Millions of consumers’ data and privacy were compromised as a result of these attacks.

Simultaneously, there are social movements brewing centered on the privacy of citizens and how the government collects its own data on people – which came to light in the wake of releases on WikiLeaks from former government contractor Edward Snowden.

Dr. Wendy Zeitlin, assistant professor at Yeshiva University’s Wurzweiler School of Social Work, has a background in financial management, social work and research. From her perspective, the market is at a critical point. “I think the pendulum is swinging right now, and privacy issues will have to be redefined, possibly through litigation as people begin to feel their privacy has been substantially violated,” she said.

Zeitlin went on to say that in some ways, a lack of privacy is often helpful to society. “Take, for instance, the push to put body cameras on police officers,” she said. “Pilot studies show that use of these cameras is associated with less excessive use of force and fewer complaints against police officers. This pretty much seems like a win-win.”

That said, Zeitlin said the greater concern is how data is used. “For example, I think we have to assume that if we use credit cards or store loyalty cards, we are being tracked, and everything about us is being tracked,” she said. “If I go into Nordstrom and buy a dress, everything about me and that purchase can be recorded from my size, to fabric, to the department that I shop in, to what styles I like, how much I’m willing to pay for a garment and more.”

Indeed, this is exactly what is driving data mining at retail. But from a sociological perspective, is it harming people? “As for harmful or not, I think it could be marginally helpful and potentially very harmful,” Zeitlin said. “It’s all how the information that is collected is used and by whom, and that’s where I think things will eventually get dicey.”