Slashdot Mirror


Coding Styles Survive Binary Compilation, Could Lead Investigators Back To Programmers (princeton.edu)

An anonymous reader writes: Researchers have created an algorithm that can accurately detect code written by different programmers (PDF), even if the code has been compiled into an executable binary. Because of open source coding repositories like GitHub, state agencies can build a database of all developers and their coding styles, and then easily compare the coding style used in "anti-establishment" software to detect the culprit. Despite all the privacy implications this research may have, the algorithm can also be used by security researchers to track down malware authors. We also discussed an earlier phase of this research.

13 of 164 comments (clear)

  1. Privacy implications? by Registered+Coward+v2 · · Score: 3, Insightful

    People have been analyzing writing styles for a long time to try to identify authors. Expecting your coding style to be obfuscated by compiling it has proven to be as wrong as thinking your identity is shielded if you publish under a pseudonym. If you make your code publicly available you really shouldn't have any expectation of privacy.

    --
    I'm a consultant - I convert gibberish into cash-flow.
    1. Re:Privacy implications? by Anonymous Coward · · Score: 4, Insightful

      I doubt it. Your code once compiled will be very similar to most other similarly skilled programmers in that language, unless you go out of your way to be obfuscate things - i.e. a poor coder. Compilers, libraries, APIs, language versions and proprietary extensions are beyond your coding style. This entire premise assumes there will be no false-positives, which will be the vast majority of hits. So basically, they're casting nets, and claiming success when they get one, ignoring the other thousand. Once you're at the binary, coding style has all but gone (assuming you're not doing assembler, which even then, will come down to the same few solutions to a given functional requirement).

  2. Heck by vikingpower · · Score: 3, Funny

    gotta change my indentation style and public void( String s1 ) whitespace habit, now the guvnmunt automagically can also get these out of binaries built from my code. O gawd, I'm afraid now.

    --
    Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
    1. Re:Heck by JaredOfEuropa · · Score: 3, Interesting

      Ideally there is such an enforced coding standard, but I have worked in situations with merged teams or projects where coding styles were rather mixed. From what I could see, cosmetic stuff like braces and indentations caused some annoyance but it didn't really lead to much lost coding time, increased effort in fixing or changing things, or an increase in bugs.

      Anyway, brace placement won't survive compilation so this method is useless for rooting out the K&R traitors.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
  3. Fuck that. by Anonymous Coward · · Score: 3, Insightful

    Aren't we being tracked enough as it is?
    Why for fucks sake why?

    My new years resolution will to remove all my code from all public repositories.

  4. Accuracy 52% with 600 programmers and 8 samples by El_Muerte_TDS · · Score: 4, Insightful

    Good luck when your programmer pool is a couple of thousand and your samples consist out of obfuscated and underhanded software which is often produced by malware creators.

  5. Stackoverflow is the culprit! by WarmBoota · · Score: 4, Funny

    Good luck tracking me!! I copy all of my code from Stackoverflow!

    --
    90% of everything is crap. Also, crap is relative.
  6. Oh really? by Viol8 · · Score: 4, Insightful

    If you RTFA it seems their sample size was 20 programmers. Occasionally they went up to 100 and they're getting something like 60-80% accuracy. BFD.

    Guys - when you've sampled the compiled, optimised binary output (with all debug info stripped) of a million coders all using different compilers on different architectures and are getting at least a 99% accuracy rate, get back to us. In the meantime, I'm sure you'll get some nice marks from your supervisors but I won't be losing any sleep.

  7. Re:I doubt this by Lab+Rat+Jason · · Score: 4, Interesting

    This is why I steal most of my functional code from GitHub in the first place...

    --OR--

    Easy to avoid detection by simply NOT UPLOADING code to GitHub in the first place. The assumption that every dev does this is stupid.

    --
    Which has more power: the hammer, or the anvil?
  8. Re:I doubt this by Anonymous Coward · · Score: 3, Interesting

    As a systems admin I have been called upon at times to automate a few things. Doing so in my situation seemed easiest with vb.net. (Yes I know the actual programmers here are recoiling with horror. Stuff it, the program works, and saves me vast amounts of time)

    In that program somewhere around 5% are lines that I actually coded. Everything else is snippets of code from Microsoft's help files, question/answer sites, and similar opensource programs found online. Unless they are checking for things like the fact that I included no error handling (since I am the only one that uses said program) I fail to see how this would work at all.

    The variable naming conventions are many and varied, there are almost no unique lines of code in the program, and it uses only standard libraries. On top of that I don't have any other programs accredited to me floating around the interwebs, at least in vb.net, so there is nothing to compare it to.

    So how exactly are they going to tell you who wrote that monstrosity? In fact it sounds like their algorithm depends upon the author having other accredited works available out there. So if you don't put anything up on public code sharing sights, you have nothing to worry about.

  9. What if the style was "idiomatic"? by mark-t · · Score: 3, Interesting

    It seems to me like the easiest way to avoid being identified in this regard would be to write code that follows any published general style guidelines or otherwise very common conventions.

    As a side effect, it will make your source code more readable to others, which is beneficial if you are on a programming team.

  10. possible upside by Gravis+Zero · · Score: 3, Interesting

    while i don't think you'll be able to identify an exact person, i do think this technology could be used to identify code that is prone to error and exploitation or even code that is for exploitation.

    --
    Anons need not reply. Questions end with a question mark.
  11. Re:Frist! by ShanghaiBill · · Score: 4, Interesting

    False positives are not a problem if you deal with them rationally. If a woman is murdered, and the DNA matches one in a million, then in a country of 300 million, there will be 300 matches, and 299 false positives. But if only one lives in the same city, and it happens to be her ex-boyfriend, then the DNA match is useful information.