Code Stylometry: Can Your Programming Habits Give You Away?
Two programmers can make software do the same job while writing it quite differently. Code stylometry studies those differences to estimate who wrote the code, even when the author's name is missing.
The clues can include spacing, naming habits, and the way instructions are arranged. They can help an investigation, but they aren't a signature that uniquely identifies a person every time.
How Your Browser Gives You Away
The habits hiding in working code
Source code is the human-readable set of instructions a programmer writes. Within the rules of a programming language, its author usually has choices about how to express an idea.
One developer might name a stored value total_items; another might prefer itemCount. A variable is the name used to refer to such a value, so those choices can leave a pattern across many files.
There are deeper clues, too. A programmer might favor a particular way to repeat a task, divide work into reusable pieces, or arrange instructions inside other instructions.
Features are measurable properties used for comparison, such as the naming, layout, and structural patterns described by researcher Aylin Caliskan. A feature might count a naming pattern or capture part of the code's grammatical structure.
In a 2015 study presented at USENIX Security, researchers used structural features to distinguish programmers' submissions to the Google Code Jam competition. That work showed why looking beyond visible formatting can reveal useful authorship clues.
Simply removing comments—the notes programmers leave in code—or changing indentation, the spaces at the start of lines, doesn't necessarily remove every clue.
How a comparison becomes an attribution
Authorship attribution means assigning a piece of work to a likely author. A common approach starts with samples whose authors are already known.
- Type more comfortably with switches you can tune to your touch.
- Remap keys and build macros in your browser, with nothing to install.
- Switch between your computers over wireless or USB-C.
Software measures features in those samples and learns patterns associated with each author. This is machine learning: building a statistical model from examples, then applying it to new material.
The model compares an unknown sample with what it learned and produces a prediction. That prediction depends on the examples, the features chosen, and the assumptions built into the test.
One assumption is especially important: is the actual author among the candidates?
A system made to choose between ten known programmers can still select one when an eleventh person wrote the code. A useful evaluation needs to examine unfamiliar authors as well as mistakes among known ones.
A 2019 study of collaborative software projects explored these issues using short code contributions. It found that combining several contributions associated with the same author could improve attribution compared with examining individual fragments.
OSINT Is More Than Searching Online
Real projects make messy evidence
A file can pass through several people's hands. One person writes a section, another changes it, and a third applies a shared style guide.
The resulting code may contain several people's habits. A short fragment may also offer too little evidence to distinguish an individual from the conventions of the project.
Those complications help explain why success on complete contest submissions shouldn't be treated as a promised success rate for every software investigation.
Style can also be changed deliberately. In a 2019 USENIX Security paper, researchers changed code while preserving its behavior and caused two studied attribution methods to make wrong predictions, including predictions pointing to another author.
The result demonstrates a weakness in those tested methods. It doesn't establish that every attribution system is equally easy to fool—or that every attempted disguise succeeds.
- Learn how you are tracked online and how to cut it down.
- Pick up practical privacy habits you can start today.
- Get advice from someone who once evaded the FBI.
Useful leads, serious consequences
Code stylometry can help connect suspicious software samples or examine disputed authorship. It can also threaten the privacy of people who publish code under an assumed name if their work can be linked to known samples.
Attribution and plagiarism detection answer different questions. The first asks who likely wrote something; the second investigates whether someone copied another person's work without proper credit.
Code-comparison tools can flag similarities without resolving that second question. The creator of Stanford's Moss similarity system explicitly warns that a similarity score isn't proof of plagiarism.
Before treating a stylometry result as an accusation, examine the comparison samples, shared code, collaboration history, and known error rates. A useful lead should invite closer inspection, not end it.
Reverse Engineering: How Analysts Work Out What Software Does

Fingerprinting: How Small Browser Details Can Give You Away

Threat Actors: What a Group Name Tells You

QUOTE:
"Amateurs hack systems, professionals hack people."

