news conference on Gozi virus
US Attorney for the Southern District of New York Preet Bharara holds a news conference on the Gozi Virus Reuters

A Latvian hacker who was extradited to the US where he pleaded guilty to writing the infamous Gozi computer virus that infected more than a million computers, is expected to return home soon. Deniss Calovskis admitted conspiring to commit computer intrusion at a hearing in New York and could be sentenced to up to two years in prison when he returns to the US in December this year.

. "I knew what I was doing was against the law," Calovskis told a magistrate judge, according to Sky News. The 30-year-old appeared at a hearing in Manhattan on Friday afternoon where he had faced up to 67 years in jail before entering into a plea bargain agreement with US authorities

During his hearing Calovskis revealed he was hired to author the virus which hit 40,000 computers in the US and 190 at Nasa, along with computers in the UK, Germany, Poland, France, Finland, Italy and Turkey. He was arrested in Latvia in 2012, but he was not extradited to the US until February this year.

Authorities said that the hackers disguised the virus by making it look like a benign PDF document. But when opened the file installed complex software on their computers to collect bank account numbers, usernames and passwords. It enabled the virus' owners to obtain millions of dollars from victims.

Prosecutors allege Calvoskis used the screen name "Miami" and developed the code that altered the appearance of banking websites and tricking victims into revealing personal information. Sentencing for Calovskis is scheduled for 14 December.

The scheme is said to have began in 2005, when Russian Nikita Vladimirovich Kuzmin hired a Calvoskis to write code for the virus. It is also alleged Calvoskis began selling the code to other hackers for $50,000, plus a cut of the profits, said the Huffington Post.

The 25-year-old Kuzmin, pleaded guilty to computer intrusion and fraud charges in Manhattan in May 2011, also admitted his role in creating the virus. A third suspect, Romanian Mihai Pauneschu, was arrested in December 2012 and his extradition remains pending, according to NBC.

US security experts say they discovered Gozi in Europe in 2007 before it spread to the US in 2010. Among the victims were businesses and government entities such as Nasa.