From keycards to touchpads, scientists have developed all sorts of alternatives to conventional metal keys. Now researchers at the University of Washington have developed a “smart” fabric that they say can be used to create clothing programmed with the wearer’s identity — making it possible to open doors at home and at work with just the swipe of a shirt cuff.

“With our approach we can transform everyday clothes like a shirt into a magnetic hard drive that can store codes and images, and which can be thrown into a washer and dryer without any loss of information,” Justin Chan, a Ph.D. student in computer science and engineering at the university and the lead author of a recent study about the new technology, told NBC News MACH in an email.

For the research, Chan and his colleagues used sewing machines and off-the-shelf conductive thread to create magnetizable embroidery. Then, they used a magnet to "program" sections of the embroidery with positive or negative poles to represent the zeros and ones of digital passcodes. These resulting codes can be read by a magnetometer, an inexpensive sensor that detects magnetic fields.

Get the mach newsletter. This site is protected by recaptcha

In one test, the researchers programmed a shirtsleeve patch with the passcode for an electronic door lock. They were able to unlock the door by swiping the cuff in front of an array of magnetometers affixed to the door.

Chan says the technology is a less expensive alternative to conventional keycards, which store passcodes in radio-frequency identification (RFID) chips that use electromagnetic fields to identify people or objects. “RFID readers can cost hundreds of dollars, whereas each magnetometer can retail for under a dollar,” he told MACH. “You can have a much cheaper reader and be able to read information that’s on your clothes.”

The patches of fabric developed by Chan and his team could be sewn into clothing at the time of manufacture, and then later programmed with individual magnetic passcodes in much the same way that hotel staff now program keycards for guests.

The smart fabric could also be sewn into workers' uniforms, Chan says, so that "instead of scanning an RFID keycard to get to work everyday, these employees can instead scan the cuff of their shirt against a reader and easily access authorized areas."

Finally, the researchers say clothing retailers could use the new technology for inventory control, with magnetic barcodes or security tags sewn into the garments.

The technology was described in a paper presented Oct. 25 at an Association for Computing Machinery symposium in Quebec City, Canada.

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.