Who knew getting a clean pair of undies was so complicated in space?

Apparently NASA did, since the federal space agency commissioned a new washing machine designed for astronauts to get a clean change of underwear every day. An energy and water-efficient machine on board the International Space Station (ISS) could save astronauts from enduring the stench of dirty garments and having to send them out into the atmosphere to be incinerated.

For short-term missions astronauts are provided with underwear that is re-supplied by regular Soyuz rocket missions, but this method is costly and cannot be sustained for longer lunar missions.

On a long-duration mission to Mars you won't have resupply -- you either have to fly naked or have a washing machine, William Michalek, project manager at the UMPQUA Research Company, a Myrtle Creek, Ore.-based space technology company, told MSNBC.com.

NASA has teamed up with UMPQUA to design a washing machine that will work with minimal water and energy in a low gravity environment, officials said.

The machine will be based on UMPQUA's already built microgravity-compatible Single Phase Laundry System. It cleans clothes using sealed plastic bags, water jets and no air.  The jets bend the clothes back and forth to work the soap solution through all the fibers, Michalek told the InnovationNewsDaily. The garments are then dried using a blast of microwaves and a tumble cycle of air jets works to soften the fabrics.

With NASA's funding, UMPQUA is working to create a more energy efficient version of this system. They are looking for ways to vaporize some of the water to create more space in the bags.

The project has attracted a lot of attention on earth, with people asking when water-efficient machines will enter their households.

When we get to the point where we're wearing dirty clothes because we don't have enough water to wash them, Michalek said adding that such a machine could be used on maritime vessels and in other isolated areas -- Mars and the moon.