A drug dealer caught after police cracked an encrypted phone full of damning messages has been jailed for eight years.
Darren Collin's arrest led to the seizure of £1.3m worth of heroin and cocaine as well as £517,000 in cash.
A Berlingo van he was driving in Glasgow was found to have a secret compartment used to smuggle drugs..
An encrypted mobile also contained incriminating messages to Collin, whose user name was "Big Poppa".
Collin was sentenced at the High Court in Glasgow having earlier admitted to being concerned in the supply of heroin and cocaine.
He was brought to justice as part of the UK-wide Operation Venetic during which experts managed to crack the encryption used by Encrochat - a global communication system used by criminals.
The court heard he was under police surveillance in April this year, and was seen driving an expensive Audi SQ7 before getting into the van.
He later carried out what appeared to be drug transactions including collecting three large tubs in the Dawsholm Road Industrial Estate near the city's Anniesland.
When he was stopped soon afterwards, mobile phones were found including a white V Smart device which was encrypted.
When decrypted, it emerged Collin had texted "Been caught" to an associate moments after he was stopped.
The device revealed Collin was regularly in touch with 10 contacts who had nicknames including "icecream", "blackhorse", "magicstopper" and "tinthepark.com".
Prosecutor Chris McKenna said: "There are further significant messages relating to what is assessed to be criminality such as images of white blocks.
"These are potentially cocaine with different logos embossed as well as large sums of money and tick lists."
The court heard there were also "detailed instructions" given to Collin by a contact on how to package cash and where to drop it off.
A flat in Anniesland linked to Collin was then raided where police found large consignments of heroin, cocaine, cash and substances used to bulk out drugs. Other related equipment, including a hydraulic press, were seized.
The heroin was valued at £820,500 with the cocaine at £505,580.
The judge, Lord Armstrong, said Collin's level of involvement showed the drug operation was "organised and planned" and he would have received a 12-year sentence had it not been for his guilty plea.
His defence counsel said Collin had been hit with "financial difficulties" after a back injury affected his work as a lift engineer.
Frances Connor QC said: "His father is a successful businessman, but he was too embarrassed to approach him for help. He does accept the foolishness of that."
Collin was also given a three-year Serious Crime Prevention Order designed to tackle and monitor criminals on their release from jail.
Welcoming the conviction, Det Ch Supt Philip Chapman said: "We are absolutely committed to disrupting those involved in serious and organised crime in Scotland.
"We recognise the impact this criminal activity has on individuals and the misery that it brings to our communities."