Taking food up to space is costly, and growing food in orbit is difficult and time-consuming, which is why scientists are looking at the possibility of converting astronaut poop back into something edible.

The thought may make you want to reach for the sick bag, but such a scheme could mean the difference between exploring the Universe or being stuck on Earth – we need to solve the problem of food on long-term space flights one way or another.

Now a team from Pennsylvania State University has come up with a way of using microbes to break down solid and liquid human waste very quickly, while minimising the chance of any pathogens developing. The substance that's left could be used in space food.

"It's a little strange, but the concept would be a little bit like Marmite or Vegemite where you're eating a smear of 'microbial goo'," explains one of the researchers, geoscientist Christopher House.

Using industry standard artificial poop – yes, it exists – the scientists combined it with a select number of microbes in a cylindrical system about 1.22 metres (4 feet) long.

That prompts a process called anaerobic digestion, similar to the one found in our own guts. The original pile of waste gets broken down with no oxygen needed.

But it was the next step that really put the new research ahead of processes we already use: taking nutrients out of the broken down waste and using a microbial reactor to grow a kind of foodstuff out of them.

The methane produced during anaerobic digestion was fed to another microbe, Methylococcus capsulatus, a bacterium already used by the industry to produce supplements or biomass for animal feed.

With 52 percent protein and 36 percent fats, the biomass produced with the methane-gobbling M. capsulatus could provide plenty of nutritional value for astronauts.

To reduce the chances of harmful pathogens developing mid-conversion, the researchers also managed to grow other helpful microbes in alkaline and high temperature environments, where bacteria and viruses struggle to survive.

In fact, the whole system is a little like the compact filters you might find in a fish tank, removing fish waste from the water.

"We used materials from the commercial aquarium industry but adapted them for methane production," says House.

"On the surface of the material are microbes that take solid waste from the stream and convert it to fatty acids, which are converted to methane gas by a different set of microbes on the same surface."

During tests, the team removed 49-59 percent of solids in 13 hours, which is much faster than existing waste management systems. However, this isn't a fully working product yet – just an experiment with different components in isolation.

More research will be needed to tweak the formulas being used and confirm this is actually something that can work in deep space. Meanwhile, other teams are working on ways to tackle the same problem.

For a long trip to somewhere like Mars, taking enough ready meals would take up too much space, and too much weight – more weight means more rocket fuel and more cost.

Growing food through hydroponics (soil-free farming) is an option, but it takes a long time to grow anything, and needs more energy to work, which again puts a strain on the limited resources of a spacecraft.

Ultimately, recycling the waste of our own bodies is likely to play at least some part in keeping astronauts well-fed on long journeys, and there's already a pee recycling system on board the ISS. Food could be next.

"Imagine if someone were to fine-tune our system so that you could get 85 percent of the carbon and nitrogen back from waste into protein without having to use hydroponics or artificial light," says House.

"That would be a fantastic development for deep space travel."

The research has been published in Life Sciences in Space Research.