It's one of the burning questions of the moment: how easy would it be for a country with no nuclear expertise to build an A-bomb? Forty years ago in a top-secret project, the US military set about finding out. Oliver Burkeman talks to the men who solved the nuclear puzzle in just 30 months

Dave Dobson's past is not a secret. Not technically, anyway - not since the relevant US government intelligence documents were declassified and placed in the vaults of the National Security Archive, in Washington DC. But Dobson, now 65, is a modest man, and once he had discovered his vocation - teaching physics at Beloit College, in Wisconsin - he felt no need to drop dark hints about his earlier life. You could have taken any number of classes at Beloit with Professor Dobson, until his recent retirement, without having any reason to know that in his mid-20s, working entirely as an amateur and equipped with little more than a notebook and a library card, he designed a nuclear bomb.

Today his experiences in 1964 - the year he was enlisted into a covert Pentagon operation known as the Nth Country Project - suddenly seem as terrifyingly relevant as ever. The question the project was designed to answer was a simple one: could a couple of non-experts, with brains but no access to classified research, crack the "nuclear secret"? In the aftermath of the Cuban missile crisis, panic had seeped into the arms debate. Only Britain, America, France and the Soviet Union had the bomb; the US military desperately hoped that if the instructions for building it could be kept secret, proliferation - to a fifth country, a sixth country, an "Nth country", hence the project's name - could be averted. Today, the fear is back: with al-Qaida resurgent, North Korea out of control, and nuclear rumours emanating from any number of "rogue states", we cling, at least, to the belief that not just anyone could figure out how to make an atom bomb. The trouble is that, 40 years ago, anyone did.

The quest to discover whether an amateur was up to the task presented the US Army with the profoundly bizarre challenge of trying to find people with exactly the right lack of qualifications, recalls Bob Selden, who eventually became the other half of the two-man project. (Another early participant, David Pipkorn, soon left.) Both men had physics PhDs - the hypothetical Nth country would have access to those, it was assumed - but they had no nuclear expertise, let alone access to secret research.

"It's a very strange story," says Selden, then a lowly 28-year-old soldier drafted into the army and wondering how to put his talents to use, when he received a message that Edward Teller, the father of the hydrogen bomb and the grumpy commanding figure in the US atomic programme, wanted to see him. "I went to DC and we spent an evening together. But he began to question me in great detail about the physics of making a nuclear weapon, and I didn't know anything. As the evening wore on, I knew less and less. I went away very, very discouraged. Two days later a call comes through: they want you to come to Livermore."

Livermore was the Livermore Radiation Laboratory, a fabled army facility in California, and the place where Dave Dobson, in a similarly surreal fashion, was initiated into the project. The institution's head offered him a job. The work would be "interesting", he promised, but he couldn't say more until Dobson had the required security clearance. And he couldn't get the clearance unless he accepted the job. He only learned afterwards what he was expected to do. "My first thought," he says today, with characteristic understatement, "was, 'Oh, my. That sounds like a bit of a challenge.'"

They would be working in a murky limbo between the world of military secrets and the public domain. They would have an office at Livermore, but no access to its warrens of restricted offices and corridors; they would be banned from consulting classified research but, on the other hand, anything they produced - diagrams in sketchbooks, notes on the backs of envelopes - would be automatically top secret. And since the bomb that they were designing wouldn't, of course, actually be built and detonated, they would have to follow an arcane, precisely choreographed ritual for having their work tested as they went along. They were to explain at length, on paper, what part of their developing design they wanted to test, and they would pass it, through an assigned lab worker, into Livermore's restricted world. Days later, the results would come back - though whether as the result of real tests or hypothetical calculations, they would never know.

"The goal of the participants should be to design an explosive with a militarily significant yield," read the "operating rules", unearthed by the nuclear historian Dan Stober in a recent study of the project published in the Bulletin of the Atomic Sciences. "A working context for the experiment might be that the participants have been asked to design a nuclear explosive which, if built in small numbers, would give a small nation a significant effect on their foreign relations."

Dobson's knowledge of nuclear bombs was rudimentary, to say the least. "I just had the idea that [to make a bomb] you had to quickly put a bunch of fissile material together somehow," he recalls. The two men were assigned to one of Livermore's less desirable office spaces, in a converted army barracks near the facility's perimeter. Bob Selden found a book on the Manhattan Project that culminated in America's development of the bomb. "It gave us a road map," Dobson says. "But we knew there would be important ideas they'd deliberately left out because they were secret. This was one of the things that produced a little bit of paranoia in us. Were we being led down the garden path?"

They faced one key decision, Dobson says: whether to design a gun-style bomb, like the one dropped on Hiroshima, that used a sawn-off howitzer to crash two pieces of fissile material together, or a more complex implosion bomb, like that dropped on Nagasaki. By now they were beginning to enjoy the challenge, so they went for the harder, more impressive option. "The gun device needed a large amount of material, and didn't make a very big bang," Dobson says. "The other one was more bang, less material."

Dobson and Selden had decided to assume that their fictional Nth Country had already obtained the requisite plutonium - a huge assump tion, since it would be, almost certainly, the hardest part - but there was plenty more to consider. "Obtaining the fissile material is really the major problem - that drives the whole project," says Selden. "But the process of designing the weapon - I'm always careful to point out that many people overstate how easy it is. You really have to do it right, and there are thousands of ways to do it wrong. You can't just guess."

As Stober's study noted, the two amateurs were ironically aided by information published as part of President Dwight Eisenhower's "Atoms for Peace" program, which spread word of the benefits of non-military nuclear power around the world. And Atoms for Peace was only the most prominent example of a fad for everything nuclear that propelled a huge amount of technical detail into the public domain.

Eventually, towards the end of 1966, two and a half years after they began, they were finished. "We produced a short document that described precisely, in engineering terms, what we proposed to build and what materials were involved," says Selden. "The whole works, in great detail, so that this thing could have been made by Joe's Machine Shop downtown."

Agonisingly, though, at the moment they believed they had triumphed, Dobson and Selden were kept in the dark about whether they had succeeded. Instead, for two weeks, the army put them on the lecture circuit, touring them around the upper echelons of Washington, presenting them for cross-questioning at defence and scientific agencies. Their questioners, people with the highest levels of security clearance, were instructed not to ask questions that would reveal secret information. They fell into two camps, Selden says: "One had been holding on to the hope that designing a bomb would be very difficult. The other argued that it was essentially trivial - that a high-school science student could do it in their garage." If the two physics postdocs had pulled it off, their result, it seemed, would fall somewhere between the two - "a straightforward technical problem, but one that involves some rather sophisticated physics".

Finally, after a valedictory presentation at Livermore attended by a grumpy Edward Teller, they were pulled aside by a senior researcher, Jim Frank. "Jim said, 'I bet you guys want to know how it turned out,'" Dobson recalls. "We said yes. And he told us that if it had been constructed, it would have made a pretty impressive bang." How impressive, they wanted to know. "On the same order of magnitude as Hiroshima," Frank replied.

"It's kind of a depressing thing to know, that it could be that easy," Dobson says. "On the other hand, it's far better to know the truth." And the truth today, he is certain, is that terrorists - with a bit of luck and, crucially, access to the right materials - could easily build a nuclear bomb. "Back in the 50s, there were two schools of thought - that the ideas could be kept secret, and that the material could be locked up. Now? Well, hopefully the materials can still be locked up, but we all have our doubts about that." Obtaining sufficiently enriched fissile material could be difficult but, when it comes to creating the bomb, "It turns out it's not overwhelmingly difficult. There are some subtleties that are not trivial ... but an awful lot has been published. If you were a grad student today, and you reviewed the literature, a lot of pieces would fall into place."

It was, relatively speaking, easy - so easy that both Selden and Dobson seem to have emerged from the Nth Country Experiment deeply troubled by their own capacities. Selden stayed in the military, on a career that sent him from Livermore to the army's other major research base, at Los Alamos, and is still a member of the US Air Force Scientific Advisory Board; he has been closely involved in planning how the US might respond to a nuclear terrorist incident. Dobson, meanwhile, felt so uncomfortable that he left the sector entirely. "It was one thing to work on a project which was hopefully going to illuminate the decision makers so they could see that weapons were easily designed," he says. "It was a rather different thing to go in and say, 'OK, for example, let's make a thermonuclear device that's only four inches in diameter.' That's an acceleration of the arms race, and I didn't really want to do that."

Einstein was famously said to have commented that if he had only known that his theories would lead to the development of the atom bomb, he would have been a locksmith. Dave Dobson, having designed one, got a job as a teacher.