hn.today

Horible Public Key Tricks

maurycyz.com239 points85 comments
Screenshot of Horible Public Key Tricks

The piece presents a protest against the complexity of TLS certificates while still accepting the need to encrypt web traffic. Rather than use an obviously weak private key, the author finds a way to make a trusted certificate’s public key carry a readable message. RSA’s modulus is the product of two primes, and its bytes appear in the certificate’s base64 text. The method begins with a normal RSA key, alters the upper part of the modulus to encode text, then adjusts one prime so the result is again a product of two primes. The author uses the resulting private key to request a certificate from a certificate authority, which validates the domain but does not inspect the embedded message.

The example certificate contains a joke about weak certificate-authority keys, and the author explains how to place text so it survives base64’s encoding boundaries. RSA’s standard public exponent remains unchanged, while the modulus offers roughly 150 characters in a 2,048-bit key or 320 in a 4,096-bit key. The technique reduces the key’s randomness; adjusting the primes can also make them dangerously close, and a small private exponent could create another weakness. The generator does not check for these problems. Still, the author argues that the key can be adequate for a public website because TLS forward secrecy means later discovery of the certificate’s private key does not, by itself, expose previously recorded sessions.

Read on maurycyz.com85 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.