Today I Learned

Started by windhound, September 09, 2013, 03:56:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

windhound

Post random facts and stories here.

First off:

"In Unix systems, there's a program named "login". login is the code that takes your username and password, verifies that the password you gave is the correct one for the username you gave, and if so, logs you in to the system.

For debugging purposes, Thompson put a back-door into "login". The way he did it was by modifying the C compiler. He took the code pattern for password verification, and embedded it into the C compiler, so that when it saw that pattern, it would actually generate code that accepted either the correct password for the username, or Thompson's special debugging password. In pseudo-Python:

    def compile(code):
        if (looksLikeLoginCode(code)):
            generateLoginWithBackDoor()
        else:
            compileNormally(code)

With that in the C compiler, any time that anyone compiles login, the code generated by the compiler will include Ritchie's back door.

Now comes the really clever part. Obviously, if anyone saw code like what's in that example, they'd throw a fit. That's insanely insecure, and any manager who saw that would immediately demand that it be removed. So, how can you keep the back door, but get rid of the danger of someone noticing it in the source code for the C compiler? You hack the C compiler itself:

    def compile(code):
        if (looksLikeLoginCode(code)):
            generateLoginWithBackDoor(code)
        elif (looksLikeCompilerCode(code)):
            generateCompilerWithBackDoorDetection(code)
        else:
            compileNormally(code)

What happens here is that you modify the C compiler code so that when it compiles itelf, it inserts the back-door code. So now when the C compiler compiles login, it will insert the back door code; and when it compiles the C compiler, it will insert the code that inserts the code into both login and the C compiler.

Now, you compile the C compiler with itself – getting a C compiler that includes the back-door generation code explicitly. Then you delete the back-door code from the C compiler source. But it's in the binary. So when you use that binary to produce a new version of the compiler from the source, it will insert the back-door code into the new version.

So you've now got a C compiler that inserts back-door code when it compiles itself – and that code appears nowhere in the source code of the compiler. It did exist in the code at one point – but then it got deleted. But because the C compiler is written in C, and always compiled with itself, that means thats each successive new version of the C compiler will pass along the back-door – and it will continue to appear in both login and in the C compiler, without any trace in the source code of either."

http://scienceblogs.com/goodmath/2007/04/15/strange-loops-dennis-ritchie-a/  (via Slashdot)
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Gen. Volkov

So does that mean that anyone who knows Thompson's password can hack any UNIX/Linux system?
It is said that when Rincewind dies the occult ability of the entire human race will go up by a fraction. -Terry Pratchett

cloud says: I'm pretty sure I'm immune to everything that I can be immune to...brb snorting anthrax.

Sticker334 says(Peace Alliance): OMG! HOBOES

windhound

Sort of assuming this is a cautionary tale of what could be done, but if it were done then yip.  Not so much hack, but if you knew Thompson's special debugging password you could have logged into any unix machine compiled with the backdoored C compiler.

Just shows you, even with open source software where you could (in theory) audit the code, there's no guarantee the software on your system is secure.
Not that it matters so much for home users, but gov't on gov't surveillance is another matter.

-----

Another tech-related one,
Chinese is an odd language.
http://en.wikipedia.org/wiki/Lion-Eating_Poet_in_the_Stone_Den

Keyboard input isn't quite as straightforward

" At the simple end, Wubihua assigns 5 keys to the most fundamental strokes used to write Chinese: horizontal, vertical, left-falling, right-falling/dot, and hooked/complex. You press the keys corresponding to at least the first 4 strokes, then press the key corresponding to the last, and it presents you with a list of plausible characters that match. The more keys you press, the smaller the list gets, until you're left with either an unambiguous match or you've entered all the strokes.

Other methods, like Wubizixing, go a step further, and assign keys to the radicals themselves (if you think of characters as being like molecules, radicals are atoms, and strokes are quarks; in English terms, characters are words or stems, radicals are letters, and strokes are the way you'd write those letters... like "vertical, vertical, horizontal" for "uppercase H")."
via Slashdot
http://en.wikipedia.org/wiki/Wubihua_method
http://en.wikipedia.org/wiki/Wubizixing

That, or they just use pinyin
http://en.wikipedia.org/wiki/Pinyin
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Drakus


'Another tech-related one,
Chinese is an odd language.
http://en.wikipedia.org/wiki/Lion-Eating_Poet_in_the_Stone_Den   "


I am addicted to lion!!! I shall resolve to eat TEN LIONS!!! SHISHISHIIII





meow

windhound

Lionfish are an invasive species first spotted in Florida and are now common up the southeastern shore
They're teaching sharks to nom them in an attempt to bring the population under control.
http://news.nationalgeographic.com/news/2011/03/pictures/110404-sharks-lionfish-alien-fish-invasive-species-science/#
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

Gen. Volkov

Well, its believed sharks can prey on lionfish with no ill effects, that has not been conclusively proven. Lionfish are venomous, which is why they have so few natural predators. I hope this doesn't just end up killing a bunch of sharks.
It is said that when Rincewind dies the occult ability of the entire human race will go up by a fraction. -Terry Pratchett

cloud says: I'm pretty sure I'm immune to everything that I can be immune to...brb snorting anthrax.

Sticker334 says(Peace Alliance): OMG! HOBOES

Kilkenne

Maybe the sharks will gain their venom powers...then we would need to train bears with scuba equipment to kill the sharks.

Gen. Volkov

But what if that gave the bears venom powers? The bears would be unstoppable.
It is said that when Rincewind dies the occult ability of the entire human race will go up by a fraction. -Terry Pratchett

cloud says: I'm pretty sure I'm immune to everything that I can be immune to...brb snorting anthrax.

Sticker334 says(Peace Alliance): OMG! HOBOES

windhound

The US launched a 500W nuclear reactor into orbit in 1965
After 43 days a voltage regulator failed, causing the reactor to shut down and the experiment to end.
It is, however, still up there and they expect it to be for 4000 years. 
In 1979 it started losing pieces (50+), maybe caused by a collision.

http://en.wikipedia.org/wiki/SNAP-10A
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

windhound

A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

windhound

"One of the best known real life examples of Simpson's paradox occurred when the University of California, Berkeley was sued for bias against women who had applied for admission to graduate schools there. The admission figures for the fall of 1973 showed that men applying were more likely than women to be admitted, and the difference was so large that it was unlikely to be due to chance.

But when examining the individual departments, it appeared that no department was significantly biased against women. In fact, most departments had a "small but statistically significant bias in favor of women."

http://en.wikipedia.org/wiki/Simpson%27s_paradox#Berkeley_gender_bias_case

That's actually kinda neat.
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't