The jailing of a man who planned to blow up a passenger plane with explosives hidden in his shoe has reignited the debate over terrorism.
British police say they have thwarted a Madrid-style terror attack
Home Office minister Hazel Blears said false identity was present in a third of terrorist cases and claimed ID cards would aid the battle against terrorism.
The Tories said tighter immigration controls would help. The Lib Dems said more investment and police were needed.
Saajid Badat was given 13 years' jail for conspiring to blow up a plane.
The 25-year-old, of St James Street, Gloucester, was sentenced after admitting to plotting with fellow Briton Richard Reid and a Belgian terrorist to blow up a transatlantic flight from Paris to Miami in December 2001.
Shadow attorney general Dominic Grieve said tougher immigration controls could help fight the terrorism threat.
He told BBC Radio 4's PM programme: "Individuals have been coming into this country and remaining here, some claiming asylum, some coming in illegally, who are in fact extremely ill-disposed to this country and may be threatening.
"They may also, of course, be a source of serious contamination towards other people, who are in this country legitimately, in terms of peddling their extremely unpleasant ideas."
He did, however, acknowledge that the threat did not always come "from outside".
The Tories would make ports more secure and ensure the intelligence services received the funding they required, he added.
Ms Blears said the police and intelligence services could not fight terrorism alone.
It was necessary to look at what motivated people into becoming terrorists and to have a foreign policy which addressed some of the international issues which encouraged extremist activity.
She appeared to acknowledge that ID cards would not have prevented Badat from attempting to blow up a plane but said they could help fight "domestic" terrorism too.
"We think that having an ID card scheme can help us to reduce the vulnerability of this country to the kind of incidents that have happened."
The cards would give officials a better idea of who was in Britain and what their background was, she added.
Lib Dem home affairs spokesman Mark Oaten said much more needed to be done to protect the country from terrorism than simply bringing in ID cards.
People could come to Britain for up to three months without having an ID card.
He added that the £6bn cost of the ID card system could be better used to fight the threat.
"Would it not be more effective to use part of that money to create police, help back up the intelligence services to create a proper border force and my judgement is that when you're dealing with terrorism, that will be much more effective than bluntly, a piece of plastic which sadly did not help in Madrid or New York."