Horible public key tricks maurycyz.com · 28 points · 11 comments · HN thread TL;...

@best

Horible public key tricks maurycyz.com · 28 points · 11 comments · HN thread

TL;DR Maurycy Zarzycki describes a joke project: generating a publicly trusted Let's Encrypt TLS certificate whose RSA public key modulus has been modified to embed a hidden ASCII message readable in the base64 certificate. He notes the trick weakens key entropy and that his script does not check for insecure key values, and he presents it as a protest against the ACME/certificate system rather than a serious security recommendation.

  • The author is annoyed by SSL/TLS requiring ACME automation and certificates that expire every few months, and calls his certificate a 'protest certificate'.
  • He picks two random primes, computes a modulus, overwrites bytes of n with a message, then sets q to n/p and searches for the next prime near it, so only the low-order part of the product changes.
  • The message sits in the upper half of the modulus, survives the prime adjustment, and can be misaligned by base64 grouping, which he says can be fixed in fewer than four attempts.
  • The published certificate, issued by Let's Encrypt, contains the text 'You don't actually have to pick random private keys' and a joke about a CA getting away with the number 4.
  • He acknowledges reduced key entropy, and warns that close primes or a very small d could make the key factorable, though his script does not check for these.
  • He argues forward secrecy means passive eavesdropping still requires a man-in-the-middle attack even if the key leaks.

Discussion The thread is short and mostly argues with the article's premise. The top comment by tptacek says serious attackers are man-in-the-middle attackers, so forward secrecy alone does not make an unauthenticated TLS session secure, and he dismisses the rest of the analysis. Other commenters debate whether CAs should check private keys, prompted by the eMudhra incident where a CA's key had only its last byte of entropy. The mood is skeptical and a bit dry, with some sarcasm about the author's 'the whole system doesn't even work' claim.

  • Unauthenticated TLS is not really secure (some): tptacek argues that all serious attackers are active MITM attackers, so an unauthenticated session should not be called secure, and passive-only attackers are largely obsolete.
  • CAs should not be expected to check keys (some): arcfour says it is not the CA's job to detect bad keys and that users may deliberately choose insecure keys, while noting most keys come from CSPRNGs and checking is costly at scale.
  • CAs should run a nominal weak-key check (a few): taspeotis suggests keys should at least be checked against trivial patterns, since trying values 0-255 would have caught the eMudhra key failure cheaply.
  • Key ceremonies need provable entropy sourcing (a few): alwa says CA key generation should be verifiably attested, and wonders why the number 4 slipped through, suggesting it could be detected like a placeholder string.
  • The article's criticism of TLS is overstated (a few): mplewis mocks the claim that the whole system does not work, comparing it to tearing out plumbing because of one leaking fire hydrant.

Links from the comments

#TLS #RSA #certificates #cryptography #letsEncrypt #vanityKeys