Horible public key tricks
257 points
• 2 days ago
• Article
Link
通过 ACME 协议获取并维护 SSL/TLS 证书的过程,常常被看作一项令人烦不胜烦的琐事,需要持续盯着系统,才能确保自动化流程始终正常运转。除了管理上的负担,人们还对那套依赖明文连接的 certificate authority 体系抱有某种疑虑:它在历史上甚至曾接受过极其薄弱的 keys 。
为了解决这些挫败感,有人提出了一种别出心裁的办法,用来生成 vanity certificates 。它们既能当作一种"抗议",又仍然能够提供必需的网页加密。
该方法的关键在于改造 RSA 公钥,尤其是其中的模数(modulus),把一段自定义信息嵌进去。这样,当用户用浏览器查看这份证书时,就能看到那段信息。由于 certificate authority 在校验 key 时不会进一步审查模数的具体内容,因而可以直接把 ASCII 文本塞进 key 里。由于证书中的 key 采用 base64 编码展示,作者会反复调整模数,直到期望的字符在编码结果中以正确的形式出现。通常只需对用于生成 RSA key 的质数做几处很小的改动。
从数学角度看,这种做法是先固定模数的上半部分以承载特定字符串,然后再重新计算其余的质因数,确保仍然得到一个可用的 RSA key 。具体而言,选择一个质数作为其中一项,再让第二个质数把模数"凑"到目标数值。接着再进行少量微调,使得最终乘积依然是两个质数的乘积。虽然这种改动会略微降低密钥的整体熵,但对公共网站的场景来说,这种降低被认为几乎可以忽略。现代 TLS 协议引入了前向安全性(forward secrecy),即使 private key 发生泄露,被动窃听依旧会变得异常困难。
尽管这种方式用来个性化公开证书既独特又带点幽默,但前提是:一旦被修改后的两个质数过于接近,就确实存在潜在风险。理论上,这种配置可能让攻击者更容易对模数进行因式分解,从而找回 private key 。不过由于这些 vanity keys 主要面向普通的对外公开网站,而非高安全环境,所以这种取舍被视为一次可以接受的尝试,用来测试我们在与现有网页安全基础设施互动时,究竟能把边界推到多远。
The process of obtaining and maintaining SSL/TLS certificates through the ACME protocol is often viewed as a cumbersome chore, requiring constant attention to ensure that automated systems remain functional. Beyond the administrative burden, there is a underlying skepticism regarding the efficacy of a certificate authority system that relies on plaintext connections and has historically accepted incredibly weak keys. In response to these frustrations, there is a creative approach to generating vanity certificates that serve as a form of protest while still providing necessary web encryption.
The core of this method involves manipulating the RSA public key, specifically the modulus, to embed a custom message that becomes visible when viewing the certificate in a browser. Since the certificate authority validates the key without scrutinizing the specific contents of the modulus, it is possible to embed ASCII text directly into the key. Because base64 encoding is used to represent the key in the certificate, the author adjusts the modulus until the desired characters appear correctly in the encoded output, a process that typically requires only a few minor adjustments to the prime numbers used to generate the RSA key.
Mathematically, the technique relies on fixing the upper half of the modulus to represent a specific string, then recalculating the remaining prime factors to maintain the integrity of a functional RSA key. By choosing one prime and setting the second to reach the target modulus, one can perform minor adjustments to ensure the product remains a product of two primes. While this modification slightly reduces the overall entropy of the key, the reduction is considered negligible for the purpose of a public website. Modern TLS protocols, which utilize forward secrecy, ensure that even if the private key were compromised, passive eavesdropping would remain difficult.
Although this approach creates a unique and humorous way to personalize a public certificate, it does come with potential risks if the modified prime numbers end up being too close to one another. Such a configuration could theoretically make it easier for an attacker to factor the modulus and recover the private key. Nevertheless, as these vanity keys are primarily intended for standard public-facing websites rather than high-security environments, the trade-off is viewed as an acceptable experiment in stretching the boundaries of how we interact with the web's existing security infrastructure.
90 comments • Comments Link
- 证书协议的标准实现往往趋向于相似的方案,尽管有些方法会有意采用非标准做法。
- 中间人攻击是一种持续存在的威胁;未加密的连接让网络运营者能够注入恶意内容、实施追踪并插入广告。
- 虽然 HTTPS 不能保证绝对安全,但相比 plain HTTP,它通过限制能够拦截或篡改流量的实体,显著降低了攻击面。
- 当前的 Web PKI 系统依赖集中式权威机构,这引发了对资金与潜在影响力的担忧,也带来了用户无法有效管理 trust store,或在不被浏览器干扰的情况下使用自签名证书的问题。
- Apple 的公证流程及相关年度费用给独立开发者设置了门槛;一些用户反馈身份验证环节功能失常、缺乏透明度,且几乎没有救济途径。
- 像 macOS 系统完整性保护(SIP)这样的安全措施固然有效,但关于这些层级究竟提供了真正的保护,还是只是以牺牲用户控制权为代价的"安全表演",争议依然存在。
- 证书透明度日志(Certificate Transparency logs)在理论上可能被滥用来存储非法数据,或被当作去中心化账本使用,尽管这种实验通常不被鼓励。
- 一些证书授权机构会进行基础验证,例如检查明显的弱密钥,但执行力度并不一致;保护 private keys 的责任往往主要落在用户身上。
- 对处处可见的 HTTPS 的要求从根本上改变了网络发布方式:在保护用户免受被动与主动的网络级拦截的同时,也提高了准入门槛。
- 技术写作中刻意使用的拼写错误,有时会被当作人类作者身份的信号;这类做法通常会降低可读性,给人的观感也更像是质量欠佳,而不是有效地区分作品是否由 AI 生成。
这次讨论聚焦于现代 Web 加密的必要性,以及它所不可避免带来的信任中心化之间的矛盾。尽管普遍观点认为 HTTPS 对于防止恶意内容注入、保护用户数据至关重要,但参与者也表达了对证书授权机构与应用商店把关者所设置官僚壁垒的挫败。交流中还凸显了对系统级安全的理念分歧:有人认为像 Apple 的 SIP 这类限制性措施是必要的保护,而也有人认为它们不当地削弱了用户的主权。归根结底,这场讨论反映出对当代 Web 基础设施的更广泛质疑:在标准化带来的技术优势与数字系统中个人自主性的被侵蚀之间进行权衡。 • Standard implementations of certificate protocols often converge on similar solutions, though some methods are intentionally non-standard.
• Man-in-the-middle attacks are a persistent threat, with unencrypted connections allowing for malicious content injection, tracking, and ad insertion by network operators.
• While HTTPS does not guarantee absolute security, it significantly reduces the attack surface compared to plain HTTP by limiting the entities capable of intercepting or altering traffic.
• The current Web PKI system relies on centralized authorities, creating concerns about funding, potential influence, and the inability of users to effectively manage trust stores or utilize self-signed certificates without browser interference.
• Apple's notarization process and the associated annual fees create barriers for independent developers, with some users reporting dysfunctional identity verification processes that lack transparency or recourse.
• Security measures like macOS System Integrity Protection (SIP) are effective, but debates persist regarding whether such layers constitute genuine protection or overreaching "security theater" that restricts user control.
• Certificate Transparency logs could theoretically be abused to store illicit data or function as a decentralized ledger, though such experiments are generally discouraged.
• Some certificate authorities perform basic validation, such as checking for trivially weak keys, but enforcement remains inconsistent, and the burden of securing private keys generally falls on the user.
• The requirement for ubiquitous HTTPS has fundamentally changed web publishing, raising the barrier to entry while simultaneously protecting users from passive and active network-level interception.
• Intentional misspellings in technical writing, potentially used as a signal of human authorship, often compromise readability and create perceptions of poor quality rather than effectively distinguishing work from AI generation.
The conversation centers on the tension between the necessity of modern web encryption and the centralization of trust that it necessitates. While there is a consensus that HTTPS is vital for preventing malicious content injection and protecting user data, participants expressed frustration with the bureaucratic hurdles imposed by Certificate Authorities and app store gatekeepers. The discussion also highlights a philosophical divide regarding system-level security, where some view restrictive measures like Apple's SIP as essential protections, while others argue they improperly limit user agency. Ultimately, the thread reflects a broader skepticism toward the infrastructure of the contemporary web, balancing the technical benefits of standardization against the erosion of individual autonomy in digital systems.