Four young computer hackers who masterminded cyber-attacks on targets from the CIA to Sony Pictures and media mogul Rupert Murdoch's News International, causing millions of dollars in damage, have been sentenced to jail terms.

The hackers, who were affiliated with the group Lulz Security, had all pleaded guilty to the charges and were sentenced at Southwark Crown Court in London on Thursday.

Prosecutors say they also targeted the websites of Britain's National Health Service and the UK's Serious Organised Crime Agency, and posted stolen information including emails and credit card details belonging to millions of people on file-sharing sites like Pirate Bay in 2011.

The defendants, three in their twenties and one aged 18, cost Sony $20m in revenue during an online crime spree that they boasted about on Twitter, behind their online monikers ViraL, Kayla, Topiary, and tFlow, the London court was told.

They also hacked into the computer systems of Murdoch's News International, posting a fake story purporting to be from Britain's top-selling The Sun tabloid announcing that Murdoch had committed suicide.

Judge Deborah Taylor said the group had "wreaked havoc and destruction, hiding behind aliases in the safety of their own bedrooms whilst seeking maximum publicity", and told the four that their "cyber game" had real consequences.

"You cared nothing for the privacy of others but did everything you could through your computer activities to hide your own identities while seeking publicity," she said.

She gave a 32-month sentence to Ryan Cleary, 21, who pleaded guilty to six charges including hacking into US Air Force computers at the Pentagon.

Fellow defendant Ryan Ackroyd, 26, was jailed for 30 months and Jake Davis, 20, was jailed for 24 months.

The only teenager in the group, Mustafa al-Bassam, 18, was given a suspended 20-month sentence.

Prosecutor Andrew Hadik described the hackers' actions as "cowardly and vindictive" and said they caused companies serious financial damage as well as damaging their reputations.

"Coordinating and carrying out these attacks from the safety of their own bedrooms may have made the group feel detached from the consequences of their actions," Hadik said in astatement.

"But to say it was all a bit of fun in no way reflects the reality of their actions."

Cleary also pleaded guilty to possessing child pornography and will be sentenced at a later date.

Source: Agencies