The Ken Thompson Hack
c2.com
c2.com
[Trusting Trust]: http://cm.bell-labs.com/who/ken/trust.html
I nervously laugh whenever somebody talks about "open source electronic voting"
Uh, why? I don't think anyone has seriously asserted that open source voting systems would be foolproof. On the other hand, we have actual cases where open source voting systems would have at least made serious flaws public before they were used for voting.
Besides, when you're talking "Trusting Trust", you have to worry just as much about the hardware you're voting on. Who designed and built that?
Don't let the perfect be the enemy of the good.
Also, don't replace a secure, well-tested and practically proven system that works (paper and a ballot box), with something that fosters large scale malice (electronic voting) in the name of modernizing or, even worse, preventing small scale malice.
Voting is a process with unique constraints not seen elsewhere. Not with banking, not with aviation, you name it. Mainly because each voter must be able to cast his/her vote and be able to verify if the vote is counted correct and exactly once without letting anyone else know what he/she voted for.
And since you usually need a lot of them when it's done manually, it's very probable that there's always some amount of fraud.
Now, it's probably easier to fraud if you can hack the voting machines. But let's not say that the current system really prevents fraud because it doesn't.
It's that even OS would not be sufficient.
If you must have assistance for people who can't mark a ballot paper due to disability, have the machine mark their ballot paper and count it as per normal.
Everyone knows what cheating looks like in ballot counting, the evidence of ballot stuffing is harder to hide, easier to spot and generally understood.
Even if electronic voting could be made absolutely secure, safe and fair it would not be understood by most voters, that means it really shouldn't be used. But as pointed out, it can't be made secure so just don't use it. Ban it. Destroy it. Elections must be fairly counted, seen to be fairly counted and understood how they are counted fairly.
David A. Wheeler’s Page on Fully Countering Trusting Trust through Diverse Double-Compiling (DDC) - Countering Trojan Horse attacks on Compilers
Tangentially, I'm more fascinated by the fact that Paul Karger, the lead author on [1], was a principal on a Class A1 secure hypervisor for the VAX, which DEC essentially finished, but cancelled in 1991. [2]
[1] - see paragraph 3.1 - http://hack.org/mc/texts/classic-multics.pdf [2] - http://www.cs.dartmouth.edu/~ccpalmer/classes/cs55/Content/r...
The paper kind of just leaves it at:
With the growth of individual workstations and personal computers, developers concluded (incorrectly) that security was not as important on minicomputers or single-user computers.
I think that, for multi-million dollar mainframe timesharing systems, it was easier to make the cost argument for good security, since the customer would pay for it so that they could spread out the cost of the machine on many users, between whom there was no trust.
But once you got $100k minis and $10k single user micros, why not just buy a second machine?
Of course, things turned out a little bit differently, but from a time before the ubiquitous internet, I can see it making sense to many people.
It's amazing how much more diverse the hardware/OS ecosystem was in say 1985 than it is now. A lot of good stuff has happened since then, but I think a lot of good ideas got lost, or at least are waiting to be dug up again.
Sure, in theory, a perfect KTH scheme would be undetectable, since it suborns every means of detection. But in practice it often wouldn't. A KTH virus would have to anticipate all tools which may be written to detect it, and given the modern open and closed source software world the complexity would explode.
Though yes, to accomplish this the original infection would have to basically #include a godlike AI that would be able to intelligently infect all future debugging tools.
Next, someone will look at timing and notice something strange. So, add stuff that tweaks the real-time clock to correct for this when your binary runs, when the OS gets built with your compiler. That way, running 'time' on your binary will not show anything suspicious.
Next, someone may notice a discrepancy between real-time clocks and their OS. Solution? Make sure analog clocks aren't that precise, hook all digital clocks up to a time signal, and tweak that signal if you hit slower code paths that the user shouldn't see. Also, make sure that all other computers in the world slow down whenever one of them hits one of these paths.
Next, someone will notice a discrepancy between clock time and solar time.
For that, the NSA made up the leap second.
Not sure if that's a case for or against tinfoil hats.
[2] https://en.wikipedia.org/wiki/Portable_C_Compiler
EDIT: in case you don't follow the links and realize the implications yourself, from wikipedia:
"It was very influential in its day, so much so that at the beginning of the 1980s, the majority of C compilers were based on it."
I wonder if you couldn't reduce this to the halting problem to prove that this is actually impossible.
edit: Ah, never mind. It's already been mentioned in the OP that this has to be the case.
And would be at least powerful enough to solve the halting problem.
There's nothing to doubt. A 'perfect' KTH virus is impossible.
Yes, the clock could be compromised too - but building your own clock from scratch is a lot easy than building your own computer, OS, lexer, compiler, etc.
[pre-posting edit - I see others have discussed this possibility too. I thus leave this comment purely as a testament to my own ascension to the rank of "Flaw-spotter".]
http://www.dwheeler.com/trusting-trust/Given that so many modern compilers can be traced back to GCC or LLVM these days, this requirement would seem problematic.
EDIT: As pointed out below, it would take a nearly AI level compromise to protect against this kind of attack, but at a theoretical level it would be possible.
Of course, if you control the GCC compiler, you control the Linux Kernel, and no programs run on Linux that don't rely on the kernel for reading and writing files...
And even if such a sophisticated program were written and somehow managed to not take up too much CPU time, it would at least probably result in rather large binary size increases in whatever it's injected into... even Linux isn't so big that a few hundred kilobytes wouldn't stick out like a sore thumb.