安全与密码学2017usenix.org
通过代码风格计量学对程序员进行去匿名化(2015)
De-Anonymizing Programmers via Code Stylometry (2015)
进阶 · 约 50 分钟读完前置知识:编程语言基础、抽象语法树(AST)、机器学习分类基础
导读
这篇论文研究的是:程序员写的源代码里是否存在足够独特的写作风格(stylometry),可以据此建立"编码指纹"、进而反匿名识别作者身份。核心做法不止比较空格还是 Tab 这类表层习惯,而是解析代码并利用抽象语法树(AST)特征来构造指纹,从而获得很强的区分能力。作者在评论中补充:后续研究显示这种编码风格即使经过编译、开启优化并剥离调试符号后,仍残留在二进制文件中。
HN 关注点:代码风格能反过来暴露作者身份这一隐私风险,以及"连编译后的二进制都能被溯源"这一出人意料的延伸结论。
后来怎么样
推动了代码风格取证与程序员去匿名化研究,并引出后续工作证明编码风格在编译优化、剥离调试符号后的二进制中仍可能残留,凸显发布代码或二进制的匿名性风险。
HN 评论精选
这几条评论里:质疑 1 补充 2 亲历 1
亲历共同作者确认 AST 特征是指纹强大的关键,并指出风格还能在编译后的二进制中留存。
我是这篇论文的共同作者之一。它发表已经几年了,很高兴在这里看到。论文说明程序员在源码中有独特的风格,可以提取出来做成编码风格指纹。关键不只是空格还是 Tab 这类显而易见的东西——真正让指纹变得强大的是解析代码、观察抽象语法树(AST)。我们还有一篇后续论文,显示出人意料的是,编码风格在编译后的二进制里依然存在(即使开启优化并去掉调试符号):见链接。
randomwalker查看英文原文
I'm a coauthor of this paper. It was published a couple of years ago; pleasantly surprised to see it here. The paper shows that programmers have distinctive styles in their source code that can be extracted to create a fingerprint of coding style. It's not just the obvious stuff like spaces vs. tabs -- parsing the code and looking at the Abstract Syntax Tree is what results in a powerful fingerprint. We have a follow-up to this paper showing that surprisingly, coding style survives in compiled binaries (even with optimization turned on and debugging symbols removed): https://www.princeton.edu/~aylinc/papers/caliskan-islam_when.pdf
补充补充文体计量学的实际应用案例:识别水军/马甲账号操控社区。
文体计量学(stylometry)是个很酷的领域。比如它被用来判断某个 subreddit 是否被少数马甲账号操控(附两个 r/Bitcoin 帖子链接)。(当然,研究它最多的人就是那些在追查中本聪的人 =P)
rawnlq查看英文原文
Stylometry is a really cool field. For example it was used to figure out if a subreddit was being manipulated by a small number of sock puppet accounts: https://www.reddit.com/r/Bitcoin/comments/3hf5z7/determining_manipulation_via_sock_puppet_accounts/ https://www.reddit.com/r/Bitcoin/comments/3dszzu/55_btc_bounty_for_proof_of_block_size_debate/ (and of course the people studying it the most are the ones hunting for satoshi =P)
质疑质疑语言差异:gofmt 等强制规范化会削弱指纹,并建议比较各语言的可识别性。
我很好奇这在不同编程语言之间差异有多大。在 Go 里,gofmt 让大多数人的风格选择趋于一致(Go 代码看起来都很像),命名和写法规则也相当规范化。代码越规范化,每个开发者能留下的指纹就越少。想看看哪些语言最容易、哪些最难识别出作者。
rustyfe查看英文原文
I wonder how much this varies by programming language. In Go, gofmt ensures that most stylistic choices are similar for everyone (Go code tends to look alike) and patterns and rules are fairly well codified (Go variable and function names tend to follow certain rules). The more codified the code is, the less fingerprints each developer can leave. It'd be interesting to see the most and least identifiable languages!
补充提出正面用途:用该技术帮开发者多样化自己的编码风格。
这或许可以用来做某种代码分析,给人提供改变代码结构的思路,类似于一些帮助你在写作中变化句式的自动化工具。
fenwick67查看英文原文
This could probably be used to do some sort of code analysis and give people ideas for how to structure their code differently. Similar to how there are some automated tools to help you vary your writing more.
历次讨论
- 2017Hacker News 讨论帖173 分 · 52 评
同领域还值得读
如何入侵一台已关机的电脑:在 Intel ME 中运行未签名代码
How to hack a turned-off computer, or running unsigned code in Intel ME
这篇 Black Hat 2017 白皮书讨论 Intel Management Engine(ME)的安全问题:如何在 ME 中运行未签名代码,以及攻破处于关机状态的电脑的相关…
安全与密码学2017 · 543 分 · 107 评专业 · 约 40 分钟编辑精选比特币:一种点对点的电子现金系统(2008)
Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
中本聪 2008 年发表的比特币白皮书,提出了无需可信第三方的点对点电子现金系统。
安全与密码学2017 · 536 分 · 394 评入门 · 约 45 分钟编辑精选GPRS 加密算法 GEA-1 的密码分析表明存在故意弱点
Cryptanalysis of GPRS Encryption Algorithms GEA-1 suggest intentional weakness
首次公开了对 GPRS 加密算法 GEA-1 和 GEA-2 的密码分析攻击。
安全与密码学2021 · 487 分 · 107 评专业 · 约 90 分钟编辑精选Signal 消息协议的形式化安全分析
A Formal Security Analysis of the Signal Messaging Protocol
用形式化方法分析 Signal 消息协议(TextSecure)的安全性:作者在多阶段密钥交换模型下,借助自动化证明工具对协议的密钥协商与 Double Ratchet 密钥更新…
安全与密码学2016 · 353 分 · 230 评专业 · 约 120 分钟编辑精选A2:模拟恶意硬件
A2: Analog Malicious Hardware
论文研究如何在芯片设计阶段植入模拟电路形式的恶意硬件后门,使其难以被常规检测发现。
安全与密码学2016 · 315 分 · 94 评专业 · 约 75 分钟编辑精选