More than half of prisoners in Scotland have taken drugs while behind bars, according to a new survey.
Three-quarters of inmates asked said mandatory drug testing made no difference to them taking drugs behind prison doors.
The statistics were disclosed in the annual Scottish Prison Service survey of prisoners' views.
Some 55% of convicts asked said they had used illegal drugs in jail at some point in the past.
Half of them claimed they had taken drugs in the month leading up to the survey, with 78% of these taking cannabis and 63% heroin.
The survey suggests that four out of five prisoners had used drugs in the 12-month period before they were sent to jail - in line with figures which show more than 75% of all people entering custody are found with drugs in their system.
Drug-free areas make up a third of Scotland's prison space but 19% of criminals said they continued to use drugs in these areas.
Despite mandatory testing being introduced in 1994 across Scottish jails some 76% claimed it had not affected their drug intake.
Only 39% had stopped using drugs and 34% had cut down their drug use as a result of the tests.
However, most prisoners said they had changed their drug use during their spell inside.
A total of 73% reported they were taking less drugs, 17% reported they had increased their habits while 10% reported no change.
The Scottish Tories seized on the findings to claim the Scottish Executive was failing to get to grips with the problem of drugs in prison.
Annabel Goldie MSP called on the government to adopt a "zero tolerance" stance on the issue.
She said: "It is time for this Labour-Lib Dem executive to stop wallowing in its complacency, adopt a zero tolerance policy on drugs, and make prisons entirely drugs-free areas.
"The people of Scotland will justifiably wonder how we can possibly tackle the scourge of drugs in society when this executive cannot even control them in prisons."
However, the executive rejected the Conservative's criticism.
A spokesman said: "The suggestion that we are not taking action against drugs and the misery they cause is risible.
"Drugs misuse continues to scar Scotland's communities but we are seeing real signs of progress.
"We take very seriously the problem of drugs misuse wherever it occurs, including prisons.
"Drugs are a serious and complex problem in our communities and our prisons are a microcosm of that.
"That doesn't excuse it, but the Scottish Prison Service - who are responsible for delivering drug testing and treatment programmes in prison - are committed to dealing effectively with the problem."
He said the chief inspector of prisons has highlighted concerns about the levels of drug taking, and these were being acted on by the prison service.
"We expect the Scottish Prison Service to make every effort to tackle the problem of drugs in our prisons and we will be monitoring progress closely."
© BBC News