Live data from Hacker News

Reading QR codes without a computer

qr.blinry.org

51–60 of 93 posts

Re: Reading QR codes without a computer

#51
post #20

> So is the rest all content? Not quite! There is also error correction, which is used to make sure that the QR code can still be read even if some parts are damaged, blurry, or missing. The error correction is generated by some fancy math, and we don't care about it here for the purpose of reading it by hand. This should be explained better... I mean sure, the math can be hard.. but is the error correction appended…

Barcodes use the last digit as a checksum. The checksum is some adding up the numbers and multiplying or something, then % 10 (only 0-9 possible values). As you can see with this math, the error checking has a 1/10 of a chance of coincidentally showing a correct checksum in cases where the data is incorrect. Either way, that last digit on barcodes is insignificant to the actual product's unique barcode ID. Fun story:…

Feynman could've done it, with a little luck anyway. :-)

https://www.ecb.torontomu.ca/~elf/abacus/feynman.html

Re: Reading QR codes without a computer

#52
post #3

I tried reading them manually about ten years ago, but gave up because of the mask. The mask pattern needs to be applied (xor) before you can even tell as much as the data type... Does anyone know how much it actually helps QR code readers to have this mask pattern applied? Last month, I tried to find out what the optimal error correction setting is (answer: none, if the matrix isn't damaged, like in my use-case wher…

The error correction isn't meant for folks like us who think about things like "how can I make this message smaller to increase the readability of the QR code", it's for the people that take their entire tracking parameter-infected URL and dump it into a version 25 (117x117) code and plaster it onto a huge sign out front where a bird promptly shits on it and a teenager slaps a sticker on it and somehow the data remains.

Re: Reading QR codes without a computer

#53
My son, a freshman in high school, had an Apple Watch as his first and only device for a while. One big annoyance for him was not being able to scan QR codes that are common in high school where we live. It is an affluent area and the assumption by many, including teachers, is that all of the kids have phones. Not required and they have computers, just comes up regularly.

I was considering doing a project with low quality camera to scan QR codes. We got him a phone before I started down that path.

Re: Reading QR codes without a computer

#54
post #20

> So is the rest all content? Not quite! There is also error correction, which is used to make sure that the QR code can still be read even if some parts are damaged, blurry, or missing. The error correction is generated by some fancy math, and we don't care about it here for the purpose of reading it by hand. This should be explained better... I mean sure, the math can be hard.. but is the error correction appended…

Barcodes use the last digit as a checksum. The checksum is some adding up the numbers and multiplying or something, then % 10 (only 0-9 possible values). As you can see with this math, the error checking has a 1/10 of a chance of coincidentally showing a correct checksum in cases where the data is incorrect. Either way, that last digit on barcodes is insignificant to the actual product's unique barcode ID. Fun story:…

When I worked at a grocery store in the 2000s, you didn't need the checksum digit when keying in a barcode by hand. In fact, manually entering the checksum digit would result in a "product not found" error.

So I wonder if the checker had to manually look anything up, assuming it was only the checksum digit that was frayed off.

Perhaps some POS systems do require the checksum digit for manually-entered barcodes, though.

Re: Reading QR codes without a computer

#55
post #5

Slightly off topic: One day in the late 90s or early 2000s, I wanted to transfer the contents of my Atari 8-bit disks to my PC. I did know about SIO2PC, a cable that converts between Atari's SIO port and the PC's serial port and a piece of software to go with it. But I didn't have the electronics skills to build one (even though it is actually very easy). So I ended up writing a Basic program on the Atari to read dat…

I think there's definitely a future for this type of data exfiltration via display as otherwise locked-down systems become more common.

Re: Reading QR codes without a computer

#57
post #5

Slightly off topic: One day in the late 90s or early 2000s, I wanted to transfer the contents of my Atari 8-bit disks to my PC. I did know about SIO2PC, a cable that converts between Atari's SIO port and the PC's serial port and a piece of software to go with it. But I didn't have the electronics skills to build one (even though it is actually very easy). So I ended up writing a Basic program on the Atari to read dat…

Reminds me of how the first generation iPod firmware and keys were reverse engineered. They blinked out bit patterns on the LCD backlight and used a camera to read the data in! https://mastodon.social/@bagder/111538350617290554

Re: Reading QR codes without a computer

#58
post #23
post #14

My friends often joke that a person who is checking our tickets is able to do precisely this mentally in their head – when that person is satisfied by seeing a QR code rather than scanning it. It became very popular over here with the Green Passes (EU Digital Covid Vaccination Certificates). Waiters, etc. were supposed to check whether the guests are vaccinated, but 99% of them just demanded any random QR code to be…

It would probably only take a week of training/practice for someone to get good enough to read them manually. Particularity if the vaccination codes have a common pattern - the same mask, format information and the like. I would expect you can look at a few areas to see if the person is vaccinated (though this wouldn't pick up on someone else's vaccinated status)

LOL, the EU's vaccination QR codes are 90+ modules wide, BASE 45 encoded and compressed.

Re: Reading QR codes without a computer

#59

This made me very curious about the error correction. Apparently you can design the codes to be variably durable from 7% to 30% recoverable.[0] Neat! [0] https://docs.beaconstac.com/en/articles/6018654-what-is-erro...

Error correction is a fascinating topic. Shannon discovered in the mid-20th century what the theoretical limit was, yet nobody knew how to achieve it. When we suddenly got close in the 1990s with the patent of turbocodes the community reacted with disbelief!

Of course, that's what's enabled things like fast and reliable mobile networks.

Re: Reading QR codes without a computer

#60
post #45
post #27

Earlier quoted context omitted.

There is a digital signature embedded in the QR code. No one can verify that in their head.

We don't need to verify everything though, just extract the vaccinated/not field which is probably in the same location on every QR code (or at least it should be possible to make it in the same area), and maybe the name of the person the QR code is for.

The signature is the whole point of the QR code though, otherwise someone could just trivially create a QR code that has their name and "vaccinated = yes".
Post reply on HN