A jar of Vegemite, an Australian culinary speciality Ian Waldie/Getty Images

An Australian stuck MDMA to his penis and slathered it in Vegemite hoping to evade sniffer dogs at a music festival. He was unsuccessful.

The unnamed party boy was one of 24 people arrested for drugs offences at Melbourne's Listen Out shindig. Police say many of them used their genitals to try and conceal illicit substances.

But only one of them used Vegemite – an iconic Australian breakfast spread – to try and bamboozle police dogs at the entrance.

The highly-trained pooches were not fooled and had no trouble sensing minute particles of the pure ecstasy powder through the potent mix of bitter vegetable extract and body odour.

"We found several males had the drugs wrapped in plastic and wrapped around their penis," Port Phillip Acting Inspector Stuart Bailey said.

"One smothered his MDMA in Vegemite believing the dog would not be able to detect his drugs. Wrong!"

Police and security were on high alert at this year's Listen Out in Catano Gardens after a female reveller died from a drug overdose in 2016.

The dogs identified two dozen people trying to take illegal drugs onto the site. Bailey said they were well aware of the "usual hiding places".

Police confiscated amphetamines (speed), MDMA (ecstasy), cannabis and ketamine from people attending the event, billed as "Australia's quality dance music event".

Bailey said the vast majority of the 15,000-strong crowd caused no trouble as they enjoyed sets from artists including Duke Dumont and Bryson Tiller.

"The crowd was really well-behaved from what I saw so I was really pleased. It was a warm day, St Kilda was pumping, but we didn't have that many drugs," he said.

MDMA is the pure form of ecstacy Wikimedia

"We had probably more in the medical tents because of headaches and dehydration and things of that nature."

Nineteen of the drugs offenders were given drug diversion notices, three received cannabis cautions and two will be interviewed further in relation to possessing ketamine.

In one instance, a man believed to be hallucinating on LSD became aggressive when restrained by police and had to be taken to The Alfred hospital. He made a full recovery.

A drunk man is also reported to have thrown a beer bottle at police after they detained his friend. He was subsequently charged with assault.

MDMA is illegal throughout most of the world. In Australia a person found in possession of the synthetic dance drug can be imprisoned for up to one year.

The drug has been shown to help post traumatic stress sufferers overcome their affliction. Last month, the US Food and Drug Administration gave the green light to large-scale trials by scientists hoping to introduce it to medicine.