In a matter of just a few years, smartwatches and fitness trackers have gone from curiosities to being nearly ubiquitous among affluent consumers. These devices will only get more popular as their prices come down and their capabilities improve.

Already, though, tech companies and the government are looking at the next generation of wearable technology. So-called “functional fabrics” go one step beyond the iWatch or Fitbit and actually incorporate computing power into the very fabric of a shirt or uniform. These smart fabrics represent the latest frontier in the Internet of Things, the universe of connected devices that allow your phone to start your car or flip on your home security system. Researchers hope that functional fabrics will be used in environments from the battlefield to decrease mortality rates of soldiers, to hospitals to improve mobility for people with disabilities. But they could also allow for a massive increase in the amount of data that companies and governments are able to gather.

In a major case out of Pennsylvania, detectives used a woman’s Fitbit to undercut her claims she had been sexually assaulted. In March, 2015, Jeannine Risley told police she’d been sleeping when she was attacked and raped. But when police looked at data collected by her fitness tracker, they determined she had been awake and walking around. The Fitbit made all the difference, Lancaster County District Attorney Craig Stedmen told the Today show.

And it’s not just location and bio-data that some of these devices track. Privacy researchers at the University of Illinois at Champagne-Urbana were able to compromise a Samsung Gear Live smart watch so that it told them individual key strokes a person hit on a keyboard based on their hand movement, using an app installed on the device.

“The app uses an accelerometer and gyroscope to track the micro-motion of keystrokes as a wearer types on a keyboard,” according to the University of Illinois researchers. “After collecting the sensor data, researchers ran it through a ‘Keystroke Detection’ module, which analyzed the timing of each keystroke and the net 2D displacement of the watch. For example, the left wrist moves farther to type a T than an F.”

Their findings show how smart devices can introduce unintended privacy vulnerabilities beyond even what the manufacturers realize. In this case, the watch had profound “privacy implications, as an app that is camouflaged as a pedometer, for example, could gather data from emails, search queries and other confidential documents,” the researchers found.

The federal government is investing heavily in the future of smartclothes. Earlier this month, the Department of Defense announced a new initiative called the Advanced Functional Fabrics of America (AFFOA) Alliance, with the goal of creating new, hi-tech textiles jobs in the hollowed out American manufacturing sector.

The $317 million initiative brings together 89 universities, manufacturers, and tech companies “to integrate fibers and yarns with integrated circuits, LEDs, solar cells, and other capabilities to create textiles and fabrics that can see, hear, sense, communicate, store energy, regulate temperature, monitor health, change color, and more,” according to a Pentagon press release.

The Defense Department, for example, is researching a uniform that would be responsive to light to alert a soldier if he or she were being targeted by a sniper. “If a sniper gun were aimed at a solder, even if it were an infrared beam so it’s not visible, the fibers embedded in the fabric deliver an electronic signal saying, ‘This surface is being interrogated by a laser,’” Ayman Abouraddy, a researcher at the University of Central Flordia, told the website NextGov.

“Similar functionality could be extended to thermal sensing,” Abouraddy added. “Temperature would allow one to form a temperature map of the body, and as a result be able to know if a soldier is hurt, or incapacitated, or even know what type of injury even if a soldier can’t report it.”

Researchers are looking into many other ways smart fabrics can be used to improve people’s health and everyday lives. Drexel University, for instance, is developing “a bellyband for uterine monitoring, touch-sensitive skin for robots, a haptic glove for hand therapy and textiles that can store energy,” according to their website.

For now, functional fabrics remain a niche market. Some of the early consumer products are all about regulating a runner’s body heat, which may not scale up to become a major market, but could be profitable nonetheless.

The Pentagon has been working on some version of this kind of technology for years. Whether that means stretchable touch pads or body suits with immediately identifiable biological data, the Defense Department is willing to pour money into an industry that is still in its infancy.

As these devices and fabrics become more widespread, so too will the data they collect about our public and private lives. It means that in the next few years, your outfit could say a lot more about you than just your sense of style.

Photos via http://goo.gl/FC6kVe, Justin Sullivan/Getty