The UK has the ability to launch cyber attacks but does not use it for industrial espionage like some other countries, minister Lord West has said.
He refused to be drawn on whether it was used for military purposes.
He was speaking as the government launched a new cyber security strategy aimed at combating online attacks.
He told BBC Radio 4's PM programme the UK faced coordinated cyber attacks "on a regular basis" from other countries including Russia and China.
And he confirmed that the British government had approached the Russian and Chinese governments to ask them to stop the attacks.
"We have had a dialogue with them in the past and I wouldn't want to go into what goes on in terms of debate at the moment," he told the BBC.
Pressed on whether Britain used cyber attacks itself, he said: "We do not go and attack other nations to try and find from them their industrial secrets."
But he added: "I think it would be very silly of any nation not to have an ability to use cyber space for the safety and security of its nation."
Pressed further on Britain's cyber warfare capabilities, he said: "We have an ability to do things and we have got very good and very talented people who have worked on this."
Asked how the UK could criticise other countries for using electronic espionage, when it used such tactics itself, he said: "I think that coordinated attacks on a regular basis to try and get industrial information from a nation is wrong."
He also hit back at Tory claims the government has been slow off the mark in setting up a cyber strategy, saying it had been working on the issue for some time but needed a more coordinated approach as the attacks had become "cleverer".
He claimed the UK was ahead of the rest of the world in its cyber security strategy.
Launching the strategy earlier Lord West, who has been appointed as the UK's first cyber security minister, said the government had recruited a team of former hackers for its new Cyber Security Operations Centre, based at the government's secret listening post GCHQ, in Cheltenham, to help it fight back.
They had not employed any "ultra, ultra criminals" but needed the expertise of former "naughty boys", he added.
"You need youngsters who are deep into this stuff... If they have been slightly naughty boys, very often they really enjoy stopping other naughty boys," he said.
He also confirmed that the government had developed the capability to strike back at cyber attacks, although he declined to say whether it had ever been used.
"It would be silly to say that we don't have any capability to do offensive work from Cheltenham, and I don't think I should say any more than that."
The biggest threat was from "state actors," said Lord West, but the threat from terrorists was also growing and he warned that future targets could include key businesses, the national power grid, financial markets and Whitehall departments.
He denied that hackers had successfully broken into government systems and stolen secret information.
Lord West joined Prime Minister Gordon Brown and Home Secretary Alan Johnson for a visit to Detica, a London consultancy dedicated to tackling the cyber threat.
Mr Brown said: "I think everybody knows the internet has expanded massively, information is flowing around the world, citizens are in danger of being victims of organised crime, there are potentially terrorist attacks on our community, so we are stepping up this strategic unit to look at cyber security."
But Dame Pauline Neville-Jones, for the Conservatives, said the strategy was a "missed opportunity".
"It is impossible to know how significant these announcements are because we do not know what funding will be made available to enhance our ability to tackle cyber threats. It is also not clear how these new cyber security structures fit into the existing national security machinery."
Her colleague in the Commons, Crispin Blunt, called it a "pale imitation" of an initiative launched by US President Barack Obama.
Lib Dem home affairs spokesman Tom Brake said: "This new cyber security strategy could lead to an extension of the government's invasive counter-terrorism powers which already pose significant threats to our civil liberties.
"The cyber security strategy uses broad, undefined terms that risk creating panic among the public and a demand for further government powers. We must not retreat into a Cold War mentality."
He demanded reassurances from Home Office minister John Hanson that the new unit, which will start work in September and be paid for out of existing budgets, will not be used to spy on ordinary people's internet use.
Mr Hanson said a special ethics panel would be set up to monitor the new unit and the government would work with civil liberties groups, although he declined to say which ones.
"This is about defending civil liberties and ensuring that we protect the liberties of people to enjoy their lives free of crime and free of the terrorist threat," he told MPs.
Mr Brake and Mr Blunt also asked why news of the new unit appeared to have been leaked to the media - prompting Mr Hanson to admit that it had been issued two days early in error and some newspapers had broken an embargo.
Tom Watson, until earlier this month a Cabinet Office minister in charge of digital engagement, said the opposition were missing the point: "There is state-sponsored hacking of key UK information networks on an industrial scale and we have to transform GCHQ into a spy school for geeks who are more cunning than their Chinese counterparts."