Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Nvidia announces native GPU programming in Rust(nvidia.com ↗)
    217comments
  2. Keys Not Included: recovering the signing keys for US driver's license barcodes(ryan.science ↗)
    50comments
  3. My temporary PHP fix from 2014 has nearly 20M installs. Today I'm deprecating it(jakeasmith.com ↗)
    7comments
  4. Training a 4B model to produce 81% faster query plans than Postgres(rohanbansal.com ↗)
    108comments
  5. Comparison of Malloc() Algorithms(egbert.net ↗)
    2comments
  6. Xiaomi Mimo 2.6 live post-training dashboard(xiaomi.com ↗)
    100comments
  7. The Relation Between Mathematics and Physics by Paul Dirac(cam.ac.uk ↗)
    2comments
  8. Backups Aren't Simple(filipovski.net ↗)
    118comments
  9. A 32-year-old bug walks into a Telnet server(watchtowr.com ↗)
    16comments
  10. Small programming tricks(will-keleher.com ↗)
    218comments
  11. Developing provably correct Rust code with Verus(amazon.science ↗)
    12comments
  12. Breaking the 1.58-bit Barrier for Ternary LLMs(arxiv.org ↗)
    29comments
  13. The engineering behind the US Strategic Petroleum Reserve(johnjwang.com ↗)
    74comments
  14. The Return of Sail Power: Cargo Ships Are Turning Back to the Wind(gcaptain.com ↗)
    44comments
  15. OpenSpec – A lightweight and configurable AI spec framework(openspec.dev ↗)
    53comments
  16. Cloudflare/Security-Audit-Skill(github.com/cloudflare ↗)
    4comments
  17. AWS says it can't restore some data from mideast facilities struck by Iran(wsj.com ↗)
    303comments
  18. PCB is brought to you by Fable 5(a6mzero.com ↗)
    34comments
  19. Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations(github.com/arnegiacomo ↗)
    243comments
  20. HarnessTax: How Much Does the Harness Matter for Coding Agents?(harnesstax.github.io ↗)
    43comments
  21. Performance Improvements in .NET 11(devblogs.microsoft.com/dotnet ↗)
    54comments
  22. Reversing Factorio's RNG(gegell.github.io ↗)
    25comments
  23. Japan's book scene is moving from bookstores to libraries(untranslatedjp.substack.com ↗)
    72comments
  24. Part-human part-mouse brain developed in science breakthrough(bbc.com ↗)
    22comments
  25. Jev Ultrafast: A browser agent with a dynamic, indexed action space(github.com/browser-use ↗)
    3comments
  26. US interest rates raised for first time in three years(bbc.com ↗)
    7comments
  27. Anecdotally, programmers dislike "reduce"(evanhahn.com ↗)
    219comments
  28. Reverse-engineered Jev-like model(github.com/vinnylarouge ↗)
    17comments
  29. Dream-RSI: Recursive Self-Improvement through Evolving Worlds(arxiv.org ↗)
    49comments
  30. Anatomy of a Texture(agentlien.github.io ↗)
    15comments

Keys Not Included: recovering the signing keys for US driver's license barcodes

137 pointsby 4h agoryan.science
49 comments
3h agoHN ↗

I come to HN to learn things I never realized I wanted to know.

3h agoHN ↗

At the time of this writing, the subtitle of the submission here on HN is

  recovering the signing keys for US driver's license barcodes

Notably, this subtitle doesn't appear on the blog post.

Anyway. I only see claims that the public key can be determined from license barcodes, not that a signing key can be determined. What am I missing or misunderstanding?

To head off one potential retort: While it's true that one can use a public key to encrypt data for the recipient that has the private half of that key or verify that data has been signed by the possessor of the private half of that key, I'm almost 100% certain that it's not possible to use that public key to sign data would validate to other folks as being signed by the private half of that key. It has been more than a decade since I've thought about any of this, but isn't the entire point of public-key cryptography that the public part can be distributed to your worst enemy without causing you any trouble at all?

3h agoHN ↗

Yes. The subtitle is wrong. He recovers the public key, due to the way EDCSA signing works.

3h agoHN ↗

Yup. The person who submitted this to HN is probably way less knowledgeable on this topic than the writer of the article. The article clearly labels the recovered keys as “recovered public keys” at the top.

3h agoHN ↗

Given the poster's nickname, the person who posted it and the author may be one and the same.

3h agoHN ↗

That's really neat! Seems potentially adaptable to paper currency--a verifiable QR code digital signature of the bill's serial number creates a cryptographically hard obstacle to counterfeiting!

3h agoHN ↗

combine with a central authority server network and make it blind signatures and you have untraceable e-cash.

1h agoHN ↗

No government wants untraceable e-cash. They want it fully traceable.

58m agoHN ↗

Blind signatures don’t work like that. Once you unblind them, they are very traceable. Chaumian e-cash can only be spent once for that reason.

1h agoHN ↗

It’s a bunch of static signed data, which is hard to modify but trivial to copy. Not exactly what you’d want for bank notes.

NFC and a challenge-response protocol could work, though, like e.g. the one used in biometric passports.

3h agoHN ↗

All of this is nearly pointless unless the photo itself is in the barcode and also signed. You only need a leak of a few hundred real IDs to cover all of the identifiable characteristics (hair, eye, skin color, approx height and weight). Leak a few hundred thousand a year and now you can’t even flag leaked IDs without some false positives.

A fake photo plus a valid barcode will pass any current check right? Unless you still do a secondary proprietary photo lookup that I don’t think exists.

3h agoHN ↗

I wonder if we might have the equivalent of Certificate Revocation List for IDs leaked this way.

1h agoHN ↗

And it's a classic case of Not Invented Here as well: this problem was solved decades ago and the solution is widely-deployed in passports and most European identity documents - just use NFC!

Cryptographic NFC chips are basically free these days, and any modern smartphone can read them. The photo issue is solved by having the chip contain a copy of the photo, as a few extra kilobytes of data isn't an issue when you aren't using barcodes. The copy issue is solved by having the chip sign a verifier-provided nonce together with the data, and having the government sign the chip's public key instead.

1h agoHN ↗

Biometric passports, including US ones, have supported the same protocol for decades at this point.

1h agoHN ↗

The Austrian ID card does that. It’s a really blurry black-and-white photo only, but it’s still recognizable and I find it quite impressive that any type of photo (in addition to its public key signature) can fit into a QR code at all.

3h agoHN ↗

I had a fake ID, and it being scannable was a huge selling point. Convenience stores all scan, and don't seem to care if you look underage. I was only turned down two or three times, usually at bars and restaurants.

3h agoHN ↗

The other thing I remember was California fakes folding in half and not breaking

2h agoHN ↗

The flex of the plastic is always a good way to check. Although I've held a fake NY ID and a legit one at the same time and could not tell any difference. Even did a double blind test.

2h agoHN ↗

Weirdly when I first got my California DL I thought it felt fake compared to my home state because it was so much thinner. Maybe it’s better for the environment.

2h agoHN ↗

The first thing I do with a real ID is widen the reference bars on the sides so the checkout scanner can't read it. If they want my birthday they can type it in manually, I don't need all my info in some store database.

1h agoHN ↗

Defacing a photo Id(driver's license or passport) is technically a crime.

7m agoHN ↗

While true, this is not the context that idea applies to.

3h agoHN ↗

It baffles that people think it's a bad thing to disclose a public key. That's their purpose actually. Sure we now have the post quantum computer threat, and some state actors are harvesting keys, but quantum computer is going to disrupt so much, that Id verification won't even matter really.

2h agoHN ↗

Where did you get the impression the author thinks it’s a bad thing? From the article:

These are public keys, which are meant to be published - recovering one lets anyone check a signature, not forge one.

2h agoHN ↗

I think GP and TFA mean that some of the states are afraid of public-key disclosure.

2h agoHN ↗

TFA is a bit obtuse about it, and assumes you've read their previous article on the topic, but from what I gathered, it's about whether the AAMVA would standardize cryptographically signing the barcodes of driver licenses to mitigate creating fakes in the US/CA. Cali showed it's entirely possible, but there's still no pressure for the standard to change across the board.

2h agoHN ↗

Think about it, the key analogy is just terrible. In the origin domain, losing a key is always bad, and making a key available to all is a non sequitur.

It's not like non-technical people understand asymmetric cryptography. Or even technical people, for that matter.

Maybe we should refer to the public key as an address, and the private key is just a password again. You can send stuff, securely, to an address. And you can verify the sender when you have their address (ie check the signature).

1h agoHN ↗

The key analogy is perfect for the private key and for symmetric keys. Publishing those is always bad and means you need to rekey immediately just like losing a traditional physical key to a secure building would.

The public counterpart is tricky to name but I think attaching "public" to it makes the intended usage plenty clear. There isn't really a physical counterpart unless you consider maybe those machines that check for counterfeit cash but even that's not a great fit because the pubkey is simultaneously analogous to a lock box.

1h agoHN ↗

Or how about we call it the lock. There's the (private) key, and it fits the lock (public key). You can pass the lock around, but you need the (private) key to be useful.

58m agoHN ↗

I dunno if that works or is any less confusing, to be honest.

I don’t think there’s any process or entity in the physical world that is reasonably familiar to most people that is even remotely suitable as an analogy to public key cryptography.

1h agoHN ↗

Yeah, that always bothered me about the terminology. My fix would be to call it a lock -- everyone understands that you can share those and it doesn't make them any easier to open.

1h agoHN ↗

That analogy works for encryption but doesn't really work for signature verification

1h agoHN ↗

That implies they chose not to. More likely the other states simply didn’t realize the value derived from paying a vendor to enable a ‘feature’, not realizing both the necessity of such signatures and that the cost to the vendor and mechanism of delivery is precisely the same regardless. One might consider what sort of pressures a citizen could apply to compel those states to act more to their own benefit, but I have no specific ideas to suggest at this time.

1h agoHN ↗

I think it depends on the context? It's in an ID card's design goals to be provably valid, so it's pointless to not publish its public keys, but something like SSH pubkeys, uhh, should I really be so eager to just publicly dump all of mine…?

3h agoHN ↗

Before signing, the encoder fills the field with a placeholder (0), repeated for the field's exact length - signs the entire payload including that placeholder, and then writes the real signature over the top of it. To verify, you put the placeholder back.

I hate shit like this. Do not let your crypto layer know about the structure of what it's signing. Keep security stupid.

3h agoHN ↗

Counterpoint - every real world crypto algo needs to do somewhat content aware padding or the crypto is much easier to break. Either that, or go so overboard on randomness that it adds a lot of overhead.

When you look at the details underneath more crypto, there is a lot of ah hah - and ‘doh’ - moments due to implementation realities.

3h agoHN ↗

As far as compact encodings go, this kind of patch-and-fill technique isn't particularly egregious. The alternative mentioned (where the verifier has to be aware of a bitfield that defines the to-be-signed elements) is much easier to mess up!

2h agoHN ↗

Ryan: The style of your blog is easy to read except for the pixelated monospace font. Thanks for sharing this post!

1h agoHN ↗

Should credit the authors of the Verifiable Credential library. The vendor isnt the one to credit here.

Digital verification is going to matter a lot more for objects we own rather than the objects that proxy for that (currently the main function of an ID). Identity fraud is only problematic because ownership is tied to a loose record of SIN/DL.

Having a physical medium represent ownership just shifts the burden to the state and allows for social engineering and fraud to persist.

55m agoHN ↗

Looks like the criteria were 1. No cost to the government/taxpayer. 2. Minimal work for the civil service.

50m agoHN ↗

This is a great investigation but I have two small nits:

the ZNB field is not empty and not garbage: it contains a well-formed 71-byte DER ECDSA signature, correctly Ascii85-encoded, with the right prefix and a plausible length. But it fails the cryptographic check instantly, because it was signed with somebody else's key.

Seems doubtful! I expect the forgers used a real signature from another card instead, so it has the right key but the wrong data. Reverse engineering the process as the author did and making up their own key wouldn't be of any value to the forgers.

I built a little demo to check the signatures across California, New York, and Virginia: take a picture of the barcode and check it here.

This is not wrong, but should come with a little warning. A real verifier needs to additionally check the encoded data matches the human-readable data on the front of the card.

10m agoHN ↗

A real verifier needs to additionally check the encoded data matches the human-readable data on the front of the card.

I mean, not really? Only the machine-readable part is signed, so it should be treated as the sole source of truth. Besides, only an idiot forger would put different data in the human-readable part - it would be the easiest way to get caught!