A McDonald's worker who hacked into the Facebook page of Selena Gomez and threatened to publish personal emails between the star and boyfriend Justin Bieber has been jailed for 12 months.
Gareth Crosskey, 21, posed as the American actress's step-father to convince staff at the social networking giant to change passwords to her account.
Crosskey then posted a video to YouTube demonstrating how he had hacked the page and went on to contact magazines OK and Hollywood Life offering to forward information about Miss Gomez.
He also wrote to the star's step-father Brian Teefey claiming he had hacked into at least four personal email accounts and copied emails sent between Gomez, 19, and Bieber, 18, before the couple officially announced their relationship.
He told Mr Teefey: 'Her personal email shows what her fans might want to see. I've made a copy of every email between Justin Bieber and Selena Gomez and Selena Gomez and Demi Lovato.
I think the paparazzi will have a field day' before telling him to reply 'ASAP'.
It had been claimed Crosskey prompted a wave of 'hate mail' directed at Miss Gomez after he posted 'Justin Bieber Sucks' on the stars Facebook page for her six million followers to read.
But the prosecution accepted there was no evidence to prove his connection to the message.
Crosskey claimed he hacked into the account because he wanted to show Facebook creator Mark Zuckerberg the limits of his security after his own account was hacked.
Judge John Price jailed the former fast-food worker for 12 months after he admitted two offences against the Computer Misuse Act.
He said: 'You are clever with a computer and you hacked into the private part of somebody's Facebook account - that somebody was a singer, a celebrity called Selena Gomez.
'She had a Facebook account on which she has six million friends.
'They have permission to get into part of the account and you hacked into private part by getting the private email password.
'You did that by posing as Brian Teefey, her step-father and manager and you did that, you said, to show Mark Zuckerberg that his security was inadequate.
'People deserve privacy and should not their private correspondence by email made public.
'People are entitles to privacy even those who seek publicity.'
Prosecutor Corrine Bramwell said Crosskey - known online as Pkinjor or prokill - posed as Mr Teefey to trick staff at Facebook into resetting the password to Miss Gomez's account.
She said: 'The methodology used was that using his time and computer skills set up an email account which was extremely similar to that of Selena Gomez's administrators account details
'Her manager and her step-father Brian Teefey was the administrator of her Facebook account and therefore had an email that attached to that.
'The defendant posed as Mr Teefey and contacted Facebook requesting a reset of the password of that account.
'His email was very similar to that of the true email address and as a result it seems Facebook reset the passwords as requested thereby allowing him access to the account.
'As a result of the access to the Facebook account it is suggested by the Crown that Mr Crosskey posed a message referring to Justin Bieber - Justin Bieber sucks - on her profile.
'Miss Gomez and Justin Bieber are in a relationship presently but at the time it was not known to the public.
'The impact of having that message resulted in her receiving a large quantity of mail, what you might deem hate mail, as a result.'
Miss Bramwell said Crosskey posted a video onto YouTube 'demonstrating to those interested he had control of the account'.
He also chatted with fellow hackers on hackersforum.net and boasted about his attack.
One user wrote 'When MI6 or FBI catch you let us know. I'm sure Selena Gomez's Facebook account is going to get you some attention'.
In another forum Crosskey asked for advice on whether to publicly release emails he claimed to have hacked or to sell them.
Crosskey contacted OK on January 13 and introduced himself by saying: 'I'm the one who hacked Selena Gomez'.
'He then refers to both Justin Bieber and Selena Gomez emails with a nice conversation of them flirting,' said Miss Bramwell.
He later said he had hacked the account 'to show that Facebook's new security system is crap'.
In a second email to Hollywood Life sent the same day Crosskey he said he hacked the account to 'prove that Mark's stupid security was easy to get past'.
He then wrote: 'I've a lot of information that you would love to hear about'.
Miss Bramwell said: 'There's a suggestion from him that he had access to her private emails but there's no evidence to support that.'
She said that after the cyber-attack Miss Gomez's team spent three days trying to regain control of the account.
Crosskey was eventually traced to his home in West Sussex following a joint investigation involving the FBI and MeT's E-Crime Unit said to have cost more than £50,000.
Detectives discovered that he had accessed the account from an IP address linked to his home but had also used a Wi-Fi network at the McDonald's where he was working.
Gareth Morgan, defending, said: 'This defendant was 19 when he embarked on thi course of action, he is now 21.
'He accepts his actions have caused distress and alarm and he accepts that his actions were stupid.
There appears to have been no cause or benefit from his actions.
'It would seem Selena Gomez was plucked out of the air as a person to concentrate his attentions on.
'There's nothing that would suggest her being anything more than a person in the public eye or that there was any more interest in her by this defendant than that.'
Mr Morgan said Crosskey, who has enrolled on a college course designing computer games after leaving McDonald's, launched the attack after his own Facebook account was hacked.
He did this after his own account was manipulated and hacked and, in order to demonstrate to the Facebook authorities the ease with which he was able to access Facebook accounts, he accessed through Mr Teefey's email Selena Gomez's account.'
He said Crosskey had not passed on the password to the account or distributed any of the information he claimed to have.
Mr Morgan added Crosskey's claims were nothing more than a 'puff or a boast'.
Crosskey, of Lancing, West Sussex, admitted two offences under the Computer Misuse Act. The offences took place between January 7 and 14, 2011.