A dimly lit bunker beneath Whitehall - perhaps a suitable venue for a man to say farewell to a 31-year career in what had been one of the most secret parts of the British state.

Sir Iain Lobban was joined by an assortment of spies and securocrats including former heads of GCHQ and the current chief of MI6. It was a venue not chosen by chance.

As he leaves his position as director of GCHQ, Sir Iain used his speech to try to connect the work of today's GCHQ with its predecessor at Bletchley Park which supplied vital information to Sir Winston Churchill who, from the same bunker, directed Britain's wartime efforts.

Then, the mission was intercepting and breaking the Enigma code used by the German military to communicate. Dealing with today's threats, Sir Iain argued, involved going online.

Sir Iain Lobban Born in Nigeria in 1960

Studied French and German at the University of Leeds

Joined GCHQ in 1983

Made director in July 2008

"Those who would do us harm don't want to be found. They choose certain routers or applications to hide in the darkest places of the internet. We have to enter that labyrinth to find them. We work to crack their defences," he told the audience.

Sir Iain took aim at those who saw spy agencies polluting a free internet. "We all now know that the beautiful dream of the internet as a totally ungoverned space was just that - a beautiful dream.

"Like all utopian visions, it was flawed because it failed to account for the persistence of the worst aspects of human nature.

"Alongside the blessings - the comprehensive information, the communities of interest, the commercial opportunities and efficiencies - there are the plotters, the proliferators and the paedophiles."

Image copyright Thinkstock Image caption Sir Iain said the internet contains "the worst aspects of human nature."

Sir Iain's early career was defined by the Cold War and spying on the Russians. It was an era when GCHQ's work was never talked about and in which the details of Bletchley's work had only just emerged.

Recently though, many of the secrets of GCHQ have been exposed by Edward Snowden, the American contractor who leaked thousands of documents leading to accusations from critics that GCHQ was involved in what was described as mass surveillance.

That was an idea that Sir Iain sought to challenge.

"The people who work at GCHQ would sooner walk out the door than be involved in anything remotely resembling 'mass surveillance'." he asserted.

"Secret does not have to equal sinister," he went on to say, blaming the idea partly on the portrayal of intelligence in popular culture.

Image copyright European photopress Agency Image caption American contractor Edward Snowden leaked many secrets of GCHQ

A significant portion of his speech was dedicated to talking about his staff.

He said they "are normal decent human beings - people who spend their lives outside work shopping at Sainsbury's or the Co-op, watching EastEnders and Spooks, listening to Radio 4 and TalkSport, drinking in pubs, wine bars and Cotswold tea rooms. We don't suddenly lose our souls the moment we swipe into the doughnut," he said referring to the building in Cheltenham in which they work.

But when they spy on the internet, how much do his staff actually listen to or see? The accusation has been that the kind of bulk access that GCHQ employs is invasive of people's privacy.

Sir Iain tried to undermine the idea of an all seeing agency which could listen to everything. However, he defended the idea that the agency needed to "access the internet at scale" in order to find what it needed and admitted that this would involve incidental collection of other data.

Image copyright Thinkstock

"Today, of all the communications out there globally - the emails, the texts, the images - only a small percentage are within reach of our sensors.

"Of that, we only intercept a small percentage.

"Of that, we only store a miniscule percentage for a limited period of time.

"Of that, only a small percentage is ever viewed or listened to, as permitted by our legal framework and self-evidently constrained by resource."

Of course what percentage of whose communication and the details of how they are collected were not included in the speech.

Some secrets had to remain just that, he said. But so long as there are secrets there are those who will be suspicious of the organisation and what it really gets up to.

Critics continue to argue that much more can be done to improve transparency, oversight and accountability over the agency's work.

Image copyright PA Image caption Robert Hannigan is about to take over as new director of GCHQ

The journey of GCHQ out of the dark and into the light has been slow and certainly accelerated by the revelations of Edward Snowden - who was never mentioned directly in the speech even though much of its content was in reaction to his revelations.

Many of the details being openly talked of now could have been revealed before and the signs are that, when he takes over next week, the new director of GCHQ Robert Hannigan will likely continue the trend for more openness about what the organisation does and does not do.