For spies working in this digital age, maintaining a cover story in order to covertly steal secrets has become more difficult since the advent of social media. Meanwhile, cutting-edge technology, from face-scanning biometrics to big data analytics, has become both a blessing and curse.

Officials from intelligence agencies, including the US Central Intelligence Agency (CIA) and its British equivalent MI6, or Secret Intelligence Service (SIS), are aware of the problem. The internet has changed the game, two former spies told national security blog The Cipher Brief.

Read more Cyberheist suspects charged for selling hacked weapons software to Iranian government

"Hostile intelligence services focus on our social media," said Daniel Hoffman, a former CIA chief of station.

"If they suspect someone of being an intelligence officer or a person of interest worth tracking, then they are going to dissect their social media."

Platforms like Facebook, Twitter and LinkedIn are great for civilian use, but situations become complex when you are working cloak-and-dagger missions overseas, according to Mark Kelton, a former deputy director of the CIA's National Clandestine Service.

He told the Cipher Brief that a spy's social media activities must be kept consistent with their cover, also known as a legend. The publication said that some agencies may be building social media profiles for future officers who will join in 10 years.

Kelton explained how anyone suspected of being a spy will now come under intense surveillance from counterintelligence, and social channels will be scrutinised. "Young people today are out on the internet all the time and most people have a social media presence," he explained.

"If they don't, then you ask why and look at the nature of that presence – who are they in touch with, what are they doing, is it something they actively keep up, or is it something that sits dormant, why would it sit dormant? All of those questions come to mind."

The tech challenges

Counterintelligence officers around the world will scan LinkedIn, for example, to check a timeline with facts they already know. These experts will also scan online profiles or apply facial recognition software on the target, typically gleaned from public spaces such as airports or border crossings.

"Frequently, it is just one mistake or one error that can roll up an entire operation or lead to a compromise," Kelton continued. "The issues of cameras, and that sort of thing, are something you have to consider now universally in the intelligence arena," he added.

This issue was highlighted back in 2010 after the assassination of Palestinian militant Mahmoud Al-Mabhouh by an Israeli team. The unit was caught on CCTV at the hotel were the target was killed, identifying the alleged spies. It didn't end there, the footage was later posted to YouTube.

In the UK, British intelligence chiefs recently commented on how advanced technology – including facial recognition and social networking – had become a double-edged sword. With modern computer systems, for example, travelling under assumed identities is increasingly difficult.

"The information revolution fundamentally changes our operating environment," Alex Younger, the head of MI6 said during an appearance at a security conference in Washington DC on 21 September 2016, where he praised the US National Security Agency (NSA).

"In five years' time there will be two sorts of intelligence services: those that understand this fact and have prospered, and those that don't and haven't," he continued.

"I'm determined that MI6 will be in the former category."