The former CEO of failed bitcoin exchange MtGox, which filed for bankruptcy in 2014, has been charged in Japan with embezzlement and falsifying data.

Frenchman Mark Karpelès, who has lived in Japan's capital Tokyo since 2009, was arrested six weeks ago in connection with the disappearance of hundreds of millions of dollars worth of bitcoins — a decentralized, virtual currency that saw the light of day in 2009.

Authorities suspect the 30-year-old former CEO to have personally made off with $2.6 million worth of his customers' bitcoins. Karpalès — who faces up to five years in prison if he is found guilty — has denied the charges. According to AFP, Karpalès may have spent the money on software rights. There are also reports he used some of the cash to buy a $48,000 bed for his luxury apartment in Tokyo.

"Technically, it's very easy for the CEO of a bitcoin exchange to steal from his customers, because he has access to their bitcoin wallet," explained Justin Ganivet, an expert at cybersecurity and risk management firm Lexsi.

Karpelès was first arrested by Japanese authorities on August 1st, on suspicion of creating fake bitcoins worth more than $1 million in 2013. Authorities extended his detention after issuing a new arrest warrant on charges of embezzlement.

Born in 1985, on the outskirts of the eastern French city of Dijon, the former CEO has had several run-ins with the law. In 2010, a court in Paris sentenced Karpalès to one year in jail and ordered him to pay 45,000 euros in damages to his former employer, Linux Cyberjoueur, who accused him of stealing client data.

Described by his former employer as "an IT genius," Karpalès bought MtGox in 2011, by which point the website had already started trading bitcoins. An abbreviation of "Magic: The Gathering Online eXchange," the site had started off as a market for trading cards used in the "Magic: The Gathering" fantasy game.

In June 2011, just three months after the handover, the company lost $9 million worth of bitcoins. The security breach caused the value of a bitcoin to plummet from $30 to $10 in one day.

Despite the incident, MtGox soon became known as the world's "main bitcoin exchange," French economist Philippe Herlin told VICE News.

In Januray 2014, a leaked document surfaced, claiming that MtGox had misplaced nearly 750,000 bitcoins. Karpelès — whose name also came up in the Silk Road case — blamed the loss on new security breaches. Furious MtGox customers found that they were unable to withdraw their bitcoins, and in February 2014, the company filed for bankruptcy. It admitted losing 850,000 bitcoins, worth an estimated $397 million.

"We don't know what happened. Mark Karpelès said it was theft. But it looks like he's trying to protect himself. It could be an inside job, or even a computer error. To lose the private key to accounts is like losing the key to a safe, and not being able to break in," Herlin told VICE News.

In a June 2014 interview with the Wall Street Journal, Karpalès said his biggest mistakes had concerned the company's security.

"Not just security on the system, but in the office," he told the interviewer. "We had some cases where a stranger sneaked in and took things away. We also have at least one former employee stealing the company's data."

In a blog entry from June 2015, Karpalès said he was surprised to see "most Bitcoin exchanges […] still running in a way where they hold customer funds and coins."

It is surprising too see that despite all that happened — Mark Karpeles (@MagicalTux)June 1, 2015

"It's true that all this is bad for the image of bitcoins," said Herlin. "But I don't think this will undermine [the currency], because people now know that there's a difference between the bitcoin and the exchange. When a bank files for bankruptcy, it doesn't undermine the euro," said the economist.

"The biggest challenge for an exchange is building trust," said cybersecurity expert Ganivet. "For now, we haven't observed any breach in the protocol of the actual bitcoin."

To avoid such losses, explained Ganivet, individuals can stock their bitcoins on their computers instead of in an echange. "Once the money has left the exchange, it can no longer be stolen. Exchanges mean you rely on a third person. Which is, in fact, at odds with the philosophy behind the currency," he explained.

Storing your own bitcoins is slightly more complicated, he conceded, since the user has to install a special software and create his or her own wallet. The solution may be less practical for those making frequent transactions.

MtGox customers who lost their virtual money can file a complaint and try and get some of it back through American exchange Kraken.

Follow Lucie Aubourg on Twitter: @lucieabrg