It was as a software designer at the arms giant Lockheed in the 1980s that the 67-year-old, English-born American set out on the path to infamy and fortune.
Computer viruses were beginning to emerge and spread, and his machine contracted an infection dubbed Pakistani Brain, which slowed down floppy drives and made seven precious kilobytes of memory unavailable. McAfee resolved the problem himself, but hit upon the idea of creating software that could detect malicious software and remove it automatically.
"It was an accident, like anything else in life," he later said of his invention.
By the end of the decade, his company had spawned an anti-virus industry that is now worth several billion dollars annually. McAfee himself was rich and famous within the computer industry, but his gift for self promotion would soon see him toppled from the company he founded.
In 1992 a virus called Michelangelo emerged and began to make headlines. McAfee told journalists that when activated, on 6 March, it could cripple up to five million machines, spreading worry in IT departments. In an incident that foreshadowed the "Millennium Bug" panic, the date passed without Michelangelo causing major problems, and although McAfee's firm made record profits that year, his reputation was trashed.
Once the firm went public in 1994, McAfee was shown the door and a cheque for up to $100m. Determined to leave the Silicon Valley rat race behind, he dabbled in other successful businesses, but also bought a 400 acre plot in Colorado and turned it into a yoga retreat.
Such new age pursuits were not new to McAfee, who like Steve Jobs and many northern Californians, had followed the hippy trail through India and Nepal. The anti-virus inventor also had pagans beat drums on company property and nurtured a corporate culture in which employees allegedly competed to have sex in his office, however.
"You would think that this guy was amazingly generous and kind, but he was getting something out of it. He was interested in being the center of attention," a former student at the yoga retreat told Gizmodo.
"He was surrounded by people around him who didn't have any money and were depending on him, and he could control them."
He wrote yoga books and dated a teenage girl, but before long moved on to a plush ranch in New Mexico, to develop and market a new extreme sport called aerotrekking. It involved flying a microlight dangerously low over the desert. McAfee's devotion to the sport, he told a journalist, extended to convincing an entire small town in Arizona, whose residents didn't like the noise of the aerotrekkers, that they were about to be engulfed by a national paintball convention.
The ruse was designed to distract the locals. To further convince them that he and his entourage of "Sky Gypsies" (who are remembered in one of McAfee's many tattoos) could be worse, McAfee also invented a national organisation of lesbian bikers, and announced they would hold their convention in the town.
Jeff Wise, the journalist he told this story to noted, however, that McAfee "is a notorious trickster, who's no stranger to sock puppetry".
After a novice aerotrekker died in a crash in 2006, McAfee's remaining fortune was threatened by a multimillion-dollar wrongful death lawsuit, which it has been suggested contributed to his decision to move to Belize in 2009. In a New York Times article about the travails of the super-rich during the financial crisis, he claimed he had been impoverished by bad property deals and the collapse of Lehman Brothers and had just $4m left.
His adventures in Belize have shed an altogether darker tone on the image of the knockabout playboy he had sought to portray. He claimed to be developing revolutionary antibiotics, yet boasted of dealings with local gang lords and stockpiled unlicensed firearms. Jeff Wise was contacted by resident of McAfee's Belize compound who claimed "he kept trying to set me up with these weird friends that were into polyamory and crazy kinky stuff".
Describing his set-up in an online diary called "Darkness Falls", published this week, McAfee explained: "Two of the women have committed relationships with men who also live with me. The two women are both my ex-lovers and one of the two still sleeps with me so I count her as a half. The men are both musicians, by pure accident, not by design. The other five women share my bed on a regular basis."
McAfee's bizarre world began to unravel in May, when police raided his home and arrested him on suspicion of manufacturing crystal meth and possession of an unlicensed weapon. McAfee protested his innocence to anyone who would listen.
"It began, innocently enough, with my refusal to donate to the local political boss of the district where I lived in Orange Walk and I have given at least $2million in gifts to the police departments," he said, casting further doubt on his 2009 claim he had only $4m left, which he later admitted was "not very accurate at all".
"Basically what I developed is a topical antiseptic. That's what they claimed was my meth lab," he told Gizmodo.
This week it was alleged that McAfee has nevertheless been a regular contributor to a drug makers' forum under the name "stuffmonger". The poster explained how he had been trying to purify a "super perv powder" called MDPV and had been testing the results on himself.
"I think it's the finest drug ever conceived, not just for the indescribable hypersexuality, but also for the smooth euphoria and mild comedown," he said.
Jeff Wise, who has known McAfee for several years and interviewed him many times, speculated his adventures in psychoactive chemistry may account for McAfee's most bizarre recent behaviour. Detectives want to question him over the murder of his neighbour, fellow American ex-pat Gregory Faull, but he h
as gone into hiding, while again protesting innocence in the media.