Robert Hannigan, who headed GCHQ between 2014 and 2017 said that the UK was struggling to compete due to the lack of cyber skills.
Hannigan said that parents should refrain from feeling guilty about their children spending hours in front of a computer screen over the summer holidays.
"The assumption that time online or in front of a screen is life wasted needs challenging. It is driven by fear," Hannigan said.
However not everyone agrees with Mr. Hannigan's comments.
Children's commissioner, Anne Longfield, warned parents that they should stop their children from using too much of social media, comparing it to "junk food."
Ex-GCHQ head Robert Hannigan,says children should spend more time on internet than they do already.. He shd stick to spying
— Andrew Pierce (@toryboypierce) 8 August 2017
Mr. Hannigan believes however that parents should not despair if their child enjoys spending time online.
"If you are spending a disproportionate amount of your holiday unsuccessfully attempting to separate your children from WiFi or their digital devices, do not despair," he said.
"Your poor parenting may be helping them and saving the country," Mr. Hannigan added.
An Ofcom report confirmed that children of all ages are spending far too much time online. Children between the ages of 5 to 15 spend at least 15 hours a week online.
Mr. Hannigan believes however that the more time children spend online the better it is for the future of cybersecurity, as the country needs more skilled engineers.
"This country is desperately short of engineers and computer scientists, and lacks the broad 'cyber skills' needed now, never mind in the next 20 years. The baseline of understanding is too low and often behind our competitors," he said.
"If we are to capitalize on the explosion of data that will come through the Internet of Things, and the arrival of artificial intelligence and machine learning, we need young people who have been allowed to behave like engineers: to explore, break things and put them together," he concluded.