While behind bars for an armed robbery, a Dunedin man sent a depraved letter to one of the country's most dangerous paedophiles, a court has heard.

Justin Philip Witchall, 25, was serving nearly three and a-half years at Otago Corrections Facility in April when he wrote a coded note to Glen Douglas - the first person in the country to be subject to a Public Protection Order.

The defendant's letter, containing graphic fantasies of child sex abuse, was addressed to Douglas' residence - a special facility beside Christchurch Men's Prison set up for offenders deemed too high risk to be in the community once released from jail.

The offensive material never made its way north as Witchall had written the key to the code on the back of the note.

Advertisement

According to court documents, the code used was known as "Scandinavian Runic", which used different shapes to correspond with the letters of the alphabet.

When Corrections officials sat down to decipher the message the results were shocking.

"When transcribed the letter describes and depicts deviant and torturous sexual offending against 4-year-old children," a police summary said.

It begins "To Glen", and ends "I hope you like it. Love Justin", but the majority of the material between is too explicit to be published.

Defence counsel Andrew Dawson accepted "the content was bad" but said his client had no history to suggest he would abuse children.

In 2014, Witchall was jailed for three years and five months after robbing the Shiel Hill Foodcentre of tobacco while armed with a knife. He was coming to the end of the sentence when he sent the letter.

He pleaded guilty before the Dunedin District Court to a charge of making an objectionable publication, but Dawson said it was not the most serious example of its kind.

Most such charges involved use of the internet and in this case the letter had not made its way to the intended recipient, he said.

"There's general harm to society overall over what you described in that letter, but otherwise there was no particular harm in this case," Judge John Macdonald said.

He jailed Witchall for nine months and the defendant was thus automatically added to the Child Sex Offender Register.

The judge also imposed six months' release conditions which barred the man from contact with children under 16 during that period.

Dawson opposed a photo of Witchall being published because of the embarrassment it may cause his family.

Judge Macdonald ruled that was sadly a natural consequence of the offending.