Judge Philip Babington made his comments as he sentenced two Derry men for possessing drugs with intent to supply and being concerned in the supply of drugs.
Bernard Shiels (27) of Glen Road and Aaron McCusker (23) of St. Eithne's Park both in Derry admitted being concerned in the supply of drugs, offering to supply and possessing drugs with intent to supply in August and September 2012.
After his arrest and at interview Shiels said he believed the white powder to be 'legal highs' bought over the Internet.
Police examined the mobile phone and one of the messages suggested a drug transaction and this number led police to McCusker.
A police search of McCusker's premises led him to show police where he kept his drugs.
Two phones, scales and a sum of money were seized along with bags containing white powder.
At interview McCusker made 'full and frank admissions.
The court was told that McCusker had 5 previous convictions and Shiels 14.
Judge Babbington sentenced McCusker to 12 months in prison with six months in custody and six months on licence.
Shiels was given a 14 month sentence with seven to be served in custody and seven on licence.
A sum of money found in McCusker's flat was ordered to be donated to Foyle Search and Rescue.