The classic nightmare of suddenly realizing you're naked in public could soon get a futuristic twist: it might involve the horror of losing not just your modesty but also your pass codes. Scientists recently created magnetic garments that they say can store data, automatically unlock doors or control a nearby smartphone with gestures.

The concept of interactive “smart clothing” has drawn attention in the past couple of years. For example, Google and Levi's created a touch-sensitive denim jacket that can operate a smartphone. This and other smart garments are made with conductive thread and usually require an attached electronic device.

To eliminate the need for such peripheral gear, researchers at the University of Washington recently took advantage of what they say is a previously untapped property of conductive thread: its ability to be magnetized. Using magnetic instead of electric properties of the thread “may seem like a small difference, but it's what makes this work interesting and exciting,” says Chris Harrison, a computer scientist at Carnegie Mellon University, who was not part of the research. The new technique allowed the researchers to do something they say is unique among wearables: turn them into storage devices.

The Washington team magnetized a patch of fabric embroidered with conductive thread, giving different parts of the cloth a north or south orientation that corresponded to binary 1's or 0's. This step allowed the researchers to store up to 33 million different combinations—such as pass codes for doors—on a shirt cuff. They also created magnetic gloves that could control a nearby smartphone with gestures. The team described its findings last October at a meeting of the Association for Computing Machinery.

The garments still stored data after washing, drying and ironing, but they could not escape time's eraser; after about a week, the threads' magnetic fields had weakened by around 30 percent. The researchers suggest that using custom-made thread designed to hold stronger magnetic fields might work longer. But for now the clothes may be best suited for storing temporary codes, such as those found on hotel key cards or clothing tags in stores.

Harrison says that it is “very unlikely you're ever going to achieve a comparable density [to magnetic hard drives]” with data-storing fabric, however.