Australian travellers to Indonesia beware: smuggling drugs will still earn you jail time but, if an official draft of the country's new criminal code becomes law, witches and people practising "black magic", even adulterers and those living together outside wedlock, may also be locked away.

The new draft law is meant to modernise Indonesia's 1918 Criminal Code, which was last updated in 1958, but some of its proposals constitute a big step back to the Middle Ages.

In a country where many people earnestly believe that they could be killed, injured or robbed by a sorcerer using black magic, that crime will, for the first time, become part of the criminal law.

News portal Detik.com reported late on Thursday that people guilty of using black magic to cause "someone's illness, death, mental or physical suffering", face up to five years in jail or 300 million rupiah ($A31,000) in fines.

Even claiming to have the power to cast dark spells would become a criminal offence, and if the magic was performed for financial gain, the penalty would increase by one-third. "White" magic would remain legal.