The head of GCHQ is calling for a new relationship with technology companies as the battle over iPhone encryption between Apple and the FBI rages on.

Robert Hannigan, who took over the security agency in November 2014, told an audience at an MIT event that "pragmatic responses" were needed in the privacy debate, and that a "less heated" atmosphere was needed.

Hannigan sought to dispel beliefs that he was at odds with the tech industry, which he traced back to a letter he wrote to the Financial Times upon taking up his role; he said that US tech company services had become "the command-and-control networks of choice for terrorists and criminals" .

He denied that this was an attack on the industry and argued that he wanted to start a dialogue with tech companies.

The speech comes in the wake of Apple appealing a decision by US Magistrate Judge Sheri Pym saying that Apple had to provide the FBI with software to make it easier to hack into the phone of the perpetrator of a mass shooting Syed Rizwan Farook.

Apple CEO Tim Cook argued in an open letter to customers that since such software didn’t exist, developing it would provide a potential tool to criminals and hackers.

In the speech, the GCHQ boss said that while his agency supported the existence of strong encryption and had no plans to ban it, he suggested that he wanted to work with technology companies to work around it.

"The idea that we do not favour strong encryption is alien to anyone who has worked in my organisation," said Hannigan.

"The solution is not, of course, that encryption should be weakened, let alone banned. But neither is it true that nothing can be done without weakening encryption."

However, Hannigan said that the new Investigatory Powers Bill, a new draft of which was recently released, would require companies to "provide data in clear where it is practicable or technically feasible to do so."

This would mean that GCHQ would not take as hard a stand in the ongoing Apple debate, since Apple is not withholding any information from the FBI.

Hannigan went on to say that the issue inevitably came down to a trade-off between privacy and security, that every individual has to routinely make.

Hannigan emphasised that "since the trade-offs are for society as a whole", it was up to elected representatives to decide what is acceptable.

"Democracy, for all its flaws, remains our best defence against the abuse of power and infringement of liberty and privacy, whether by Governments or industry or the individual," Hannigan said.

Antony Walker, deputy CEO of UK tech industry body techUK welcomed the speech, saying: "The solutions lie in government, academia and industry working together.

"These are hugely complex issues. This speech makes it very clear that there are no easy answers. It is a realistic assessment of the trade-offs that need to be made to secure our digital world.

"The Investigatory Powers Bill gives us the opportunity to create the best possible legal framework. To be successful it must reflect the trade-offs that need to be made. We have to be constantly wary of the long term implications of our actions. We must not jeopardise our long term security."