He said the two engineers, from defence contractor Bechtel, had worked out of an office at Apple's buildings for months.
"They wanted to add some custom hardware to an iPod and record data from this custom hardware to the iPod's disk in a way that couldn't be easily detected," he wrote.
"But it still had to look and work like a normal iPod."
The pair had been given a copy of the iPod system's source code on DVD and bought their own devices at shops to experiment on, Mr Shayer said.
"This wasn't a collaboration with Bechtel with a contract and payment," he wrote.
"It was Apple doing a favour under the table for the Department of Energy."
Nuclear power
Mr Shayer never found out exactly what the two engineers were building but suspected "something like a stealth Geiger counter" to measure radiation without being noticed.
The Department of Energy is, among other functions, responsible for nuclear power.
The story has been backed by other Apple employees of the time.
Tony Fadell, the former vice-president of the iPod division, tweeted the story was "absolutely spot on" and "real without a doubt".
You should have seen the guys behind those 2 engineers… What a trip! I’m still friends with one of them today. Crazy super cool technology the government was working on then… I can only imagine what is cooking these days. https://t.co/ysZgmq1ldm
But the high level of secrecy - and the fact the four people who had known about it had all since left Apple - meant, Mr Shayer said: "The PR people would tell you honestly that Apple has no record of any such project."