Image copyright BStU

More than 20 years after the Berlin Wall fell, you might think the Stasi had been consigned to history. But a new generation wants to know what the East German secret police did to their parents, and computing wizardry is about to make it easier to find out.

The German Democratic Republic (GDR) and its agencies did not disappear immediately once the Berlin Wall fell.

For some weeks afterwards many Stasi staff remained in their offices, trying to destroy evidence that could land them in jail or expose their spies in foreign countries.

But they ran into technical difficulties.

"The Stasi was an organisation that loved to keep paper," says Joachim Haussler, who works for the Stasi archives authority today.

It therefore owned few shredders - and those it did have were of poor East German quality and rapidly broke down. So thousands of documents were hastily torn by hand and stuffed into sacks. The plan was to burn or chemically destroy the contents later.

Image copyright AP Image caption Some papers were lost when protesters stormed Stasi HQ in 1990

But events overtook the plan, the Stasi was dissolved as angry demonstrators massed outside and invaded its offices, and the new federal authority for Stasi archives inherited all the torn paper.

It amounts, says Haussler, to "the biggest puzzle in the world", estimated at between four and six hundred million pieces of paper - some no larger than a fingernail.

The authority has had a small team in Bavaria reconstructing torn documents by hand. But humans struggle to cope with the smaller fragments. At present rates, it would take centuries to reconstruct the documents.

So now the authorities are turning to technology. Computers, says Haussler, are "quicker, cheaper and can match and remember things humans can't". The particular computer taking on the task is the "ePuzzler" made by the same people who invented the mp3 player - the Fraunhofer Institute in Berlin.

Bits of torn paper of all shapes and sizes are taken out of the sacks, ironed flat, then scanned.

Each piece, however small, is given a computer file into which is entered any information about, say, paper colour, handwriting or print on it, any significant acronyms that might link it to a particular Stasi office.

Then a complex mathematical programme is brought into action matching that information and the paper's shape with other fragments from among the millions.

A technician showed me a test run, as pieces moved around a screen before finally forming a reconstructed Stasi document.

How the ePuzzler works

Image copyright Getty Images Image caption There are 16,000 sackloads of torn documents to reassemble. The ePuzzler pilot project has tackled 400. It's important to know which Stasi department the sack came from, and also to know which pieces came out of which sack - in some cases, all the parts of a torn-up document will be in the same sack. Image copyright BStU Image caption Each fragment gets its own computer file, where key information is logged. Staples and clips are removed and the paper is cleaned. Wrinkled paper is flattened, so that the computer sees its true shape. At present, for the sake of speed, the ePuzzler does not handle pieces smaller than about 2cm by 2cm. Image copyright Other Image caption Both sides of the fragments must be scanned, and the images of each side perfectly aligned. The size and colour must be the same when fragments are scanned on different machines - and shadows must be prevented. The speed at which the ePuzzler will work depends on the extent of manpower put into the scanning process. Image copyright Other Image caption The scanners use a form of blue-screen technology to enable each fragment to be separated from the others. Before starting to work on the jigsaw, the ePuzzler creates subsets - paper of similar colour, ruled or plain paper, handwritten or typed, and - where it can be determined - date. Image copyright Other Image caption The outline of each piece of paper is expressed by a mathematical formula, which enables the ePuzzler to work out when pieces fit together. It also investigates features along the torn edge, such as the type and colour of the writing. When two or more fragments match they are digitally glued and become a larger fragment. Image copyright Getty Images Image caption A complete virtual page is a good start. But to be properly understood, it needs to be seen in the context of the whole document it came from. The Fraunhofer Institute is working on programmes that it hopes will enable pages to be assembled into virtual documents in future - and documents to be assembled into files. Image copyright Other Image caption If a reconstructed document is needed for a future court case, it may have to be presented in physical rather than virtual form. The fragments must therefore be carefully stored, so that the physical parts can be located, and glued together if and when the need arises. previous slide next slide

For Dr Bertram Nickolay, who leads the Fraunhofer team, this is a highly personal challenge. He befriended an exile from East Germany, Juergen Fuchs, who he believes had been deliberately exposed to radiation while in a Stasi prison. He died from a rare form of leukaemia.

"He died relatively young because of this exposure... so for me that's a further motivation for this project," he says.

But it is not only paper documents that are yielding their Stasi secrets. In a room in the former Stasi headquarters in Berlin, I found a small team working on digitising the thousands of sound recordings left by the secret police.

They too can yield vital information about what the Stasi did. Most recordings are unlabelled, so workers here never know what they are about to listen to.

Media playback is unsupported on your device Media caption Clips from the Stasi's audio archive. Warning: Listeners may find some parts disturbing.

Some are bizarre. There is Erich Mielke, aged head of the Stasi as the revolution against communism approached, recorded in a secret meeting trying to explain to his senior colleagues the corrupting dangers posed to East German youth by punk, skinheads and heavy metal music.

Another recording is of two agents trying clumsily to plant a bug in a flat, smashing a vase, unaware that their colleagues have already planted a bug and are listening in.

In East Germany, it sometimes seems that everyone was spying on everyone else. Other recordings are tragic. A woman in a secret 1950s Stasi trial wails desperately as she is sentenced to death.

Katri Jurichs, who runs this team, told me how making sense of these recordings often involves amazing detective work - of a kind which no computer could achieve.

Image copyright Getty Images

Her colleagues start with no idea of what or who they are listening to. If it is a recording made in someone's home, sometimes the only clue is, say, a TV football commentary in the background.

The researchers painstakingly work out who is playing in the match, when and where it was, and begin from there to piece together who is being recorded.

With hindsight... we should have trusted people more Gotthold Schramm, Former Stasi colonel

At other times audible church bells are analysed minutely to see if they match a particular town or village's bells.

So why go to so much trouble to research and reconstruct so much? Partly, the German government believes the country has a duty to come to terms with this part of its totalitarian past.

But for many individuals, too, the hope is that the Stasi documents will explain mysteries, enable people and families to understand and overcome what happened to them.

In another part of the former Stasi HQ I meet Katrin Behr, who runs an agency helping the victims of forced adoption in East Germany - children were removed by the Stasi from parents deemed politically unreliable.

In Katrin's case she was four-years-old when they came for her mother.

"When my mother unlocked the door, they tore it open. We were taken down a narrow street and to the Market square in Gera, where we were separated."

"For many years I feared that anyone on the street could take me away," she says.

She did not see her mother again for 19 years, after the fall of the Berlin Wall. But now she's hoping the reconstructed documents will explain more about how such things were possible.

"Everybody's really hoping there will be information in these documents. Of course, we can't tell how long it will take," she says.

"Even if the computer works quickly, it'll take some time for the archivists to sort everything out - but I certainly have high hopes."

And what of those who worked for the Stasi. As more emerges about their activities, and the mass of information they kept, does former Stasi colonel Gotthold Schramm have regrets?

At times, he is defiant. "You can't have collective guilt," he says. "Guilt is an individual thing."

"With hindsight, we didn't need this giant network of unofficial collaborators," he adds. "We were too worried about what might happen. We should have trusted people more."

But they did not trust the people when they were in power.

And thousands of fragmented lives, and fragmented documents, still bear powerful witness to how a secret police force spread throughout a society.

Sample document: Max from Budapest

Credit: DocumentCloud, BSTU.

The Stasi Jigsaw Puzzle will broadcast on BBC Radio 4 on Friday, 14 September 2012. Listen again via the Radio 4 website or download.