WhatsApp and similar services must hand over encrypted messages to the security services after terror attacks, the Home Secretary says.

Amber Rudd said it was “completely unacceptable” that terrorists had a “place to hide”, in the wake of the murders at Westminster last week.

The attacker, Khalid Masood, is believed to have sent messages using WhatsApp just two minutes before he launched his assault, killing four people.

The content of those messages – and to whom they were sent – is likely to be a vital clue in the hunt for any accomplices, but it is not clear that the intelligence services will be able to see it.

WhatsApp promises end-to-end encryption and Apple fought a battle with the US Justice Department to try to prevent it unlocking a terrorist’s iPhone after an attack in the US.

Ms Rudd said she hoped to reach a voluntary agreement with tech firms, but hinted she was ready to use legislation to force them to act if necessary.

“It is completely unacceptable, there should be no place for terrorists to hide,” she told the BBC’s Andrew Marr Show.

“We need to make sure that organisations like WhatsApp, and there are plenty of others like that, don’t provide a secret place for terrorists to communicate with each other.”

Arguing tech firms had a “responsibility” to cooperate, the Home Secretary added: “They cannot get away with saying they are in a different situation – they are not.”

And, hinting at forcing them to act if necessary, Ms Rudd said: “We have to have a situation where we can have our security services get into the terrorists’ communications. That’s absolutely the case.”

Appealing directly to the owners of messaging services, she said: “These people have families, have children as well – they should be on our side.”

The comments set the scene for a potentially bruising meeting between tech firms and the Home Secretary this week.

The Facebook-owned WhatsApp, which has a billion users worldwide, has said protecting private communication is one of its “core beliefs”.

Both Labour and the Liberal Democrats said they opposed new laws, Jeremy Corbyn arguing against tilting the balance against the right to privacy.

“I’ve been concerned about giving too much unaccountable power to anybody in our society, so could the security services go to court and make an application? I would have thought they probably could,” the Labour leader said.

For the Lib Dems, home affairs spokesman Brian Paddick – a former Met police deputy assistant commissioner – said: “These terrorists want to destroy our freedoms and undermine our democratic society.

“By implementing draconian laws that limit our civil liberties, we would play into their hands. Having the power to read everyone’s text messages is neither a proportionate nor an effective response.”

In her interview, Ms Rudd also insisted the likes of Google, which runs the social video sharing platform YouTube, must take more responsibility for taking down extreme material.

“Each attack confirms again the role that the internet is playing in serving as a conduit, inciting and inspiring violence, and spreading extremist ideology of all kinds.

“We need the help of social media companies, the Googles, the Twitters, the Facebooks of this world.”

Ms Rudd also confirmed the police’s strong belief that Masood – who ran down pedestrians and fatally a stabbed police officer at Parliament – acted alone.

“What we are hearing from the police is that they believe it is a lone attacker,” she said.

In pictures: Westminster attack Show all 9 1 /9 In pictures: Westminster attack In pictures: Westminster attack An air ambulance lands after gunfire sounds were heard close to the Palace of Westminster in London PA wire In pictures: Westminster attack MPs wait until the situation is under control in Westminster. 'The alleged assailant was shot by armed police,' David Lidington, leader of the House of Commons, told the house. BBC News In pictures: Westminster attack Crowds gather in Westminster after shooting incident, which police are treating as terror attack BBC News In pictures: Westminster attack Police were also called to an incident on Westminster Bridge nearby AP In pictures: Westminster attack Early reports indicate the car, which mounted the pavement on Westminster Bridge and mowed into around a dozen people, was the same vehicle which then rammed into the railings of the Palace of Westminster, just around the corner Reuters In pictures: Westminster attack Security sources described the suspected assailant as a middle-aged Asian man, who is understood to have left the car before attacking a police officer with a seven-to-eight inch knife PA wire In pictures: Westminster attack Police have asked people to avoid the immediate area to allow emergency services to deal with the ongoing incident AP In pictures: Westminster attack One woman has died and a number of others, including the police officer, have been hurt, according to a junior doctor at St Thomas' Hospital Reuters In pictures: Westminster attack At least three gun shots were heard by those inside Westminster, and proceedings in the House of Commons have been suspended AP

It comes after Ms Rudd said that while the spotlight was on tech firms, less well known companies also had a role to play – referring to secure messaging app Telegram and blog publishing website Wordpress.

“We need the help of social media ­companies: the Googles, the Twitters, the Facebooks, of this world,” she wrote in The Sunday Telegraph.