RC RANDOM CHAOS

Hiding Messages in SSL Certificate Public Keys

· via Hacker News

Original source

Horible public key tricks

Hacker News →

The author critiques SSL/TLS for its ACME complexity, certificate expiration every few months, and dependency on trusted certificate authorities. Proposing a compromise between encryption and simplicity, the author develops a technique to embed hidden messages within certificate public keys using vanity keys.

The method modifies an RSA modulus (n) to encode a message into its base64 representation. Beginning with two random primes, the author calculates their product, then adjusts specific bytes of the modulus to introduce the desired text. Since the modified value is no longer a valid product of two primes, it’s corrected by setting q to n/p and rounding to the next prime—typically a shift of just a few hundred. When the message is embedded into the upper half of the modulus, it’s likely to survive intact. Base64 alignment may render the message unreadable, but adjusting its placement usually resolves this in fewer than four attempts.

The approach carries security tradeoffs. It reduces the entropy of the private key, and risks exist: closely-spaced primes could enable factorization, and very small d values pose problems. However, modern TLS forward secrecy mitigates the practical impact—eavesdropping requires a man-in-the-middle attack even if the private key is compromised. The certificate authority validates the public exponent and refuses non-standard values, limiting where messages can be embedded. The available space reaches approximately 150 characters for RSA-2048 keys or 320 for RSA-4096 keys using base64 encoding.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.