Learn how QR codes work, and how to read them without a computer!

@piko and I just released the interactive explainer that we used in our workshop at #37c3!

https://qr.blinry.org

Reading QR codes without a computer!

@blinry @piko FINALLY SOMEONE! Thanks!!!
@saper @blinry @piko If you understand German, perhaps have a look at https://www.arminhanisch.de/2018/10/qr-codes-lesen/QR-Codes-lesen.pdf (both of you, one for reading, one for perhaps getting input for the article). :)
@jesterchen @blinry @piko I think that understanding German is easy compared to the capability to read QR codes like that!
@blinry @piko I've been looking for a resource like this!

@blinry @piko To follow the talk was quite fun. Most probably I will never try to decode a QR code by hand.

Regarding the separators. It's mentioned there need to be empty lines around the finder pattern, highlighted on two sides. When I place the QR code on a black background it cannot be scanned any more.

* Has a QR code always to be placed on a white/light background?
* Must empty lines surround the whole finder patterns?
* Is it just a weakness in the QR code readers?
* What do I miss?

@lamitpObuS Yeah, the QR Code standard says that there's supposed to be a "quiet zone" around the code (which should be filled white). So that's probably what's happening there! If the quiet zone is not there, your reader doesn't recognize the code. @piko

@blinry @piko Thanks for the answer. The “quiet zone” was the missing link.

I now find it even on your page. Could swear it wasn't mentioned in December 2023. 🤔

@lamitpObuS It wasn't, we added it today! :D @piko
@blinry @piko Nice! I tried to learn it from wikipedia once, but fell asleep. This one had me understand it within the few minutes it took to read.
@blinry @piko Cool - Thanks for the explanation!

@blinry @piko

An excellent and approachable write-up. I hope I never find myself in a situation where I need to actually decode one of these by hand, but it's interesting to understand how it works.

@blinry @piko thank you
i can now finally throw away the fucking computer
@blinry @piko
With some training it could be an epic skill to be able to decode qr-codes without pen and paper (neither a computer). 😅

@blinry sorry but it seems broken on FF for android 😅 the qrcode is not showing at all 😩

@piko

@tsadiq Can you find out which version of the Firefox app you're using? Because it does work for me there. :O @piko

@blinry alright it's my bad actually, I had try deactivating uBlock and Privacy Badger extensions before telling you, but it turns out the culprit was Dark Reader, works just fine when I turn it off 🙈

@piko

@tsadiq @blinry @piko same for me, dark mode broke the page
@blinry @piko quick question: do you know anything about the two QR codes found in the back of Mexican voter's ID? It seems to not only have the user's information encoded, but also a color picture and they don't seem to be readable by most QR code reader apps.
@bitman @blinry @piko I'll start with that only if they have the 3 square alingnment boxes in the corners is it a QR code. Most of the data on said cards from what I can see from a google search is not in a QR Code format, but a variant of PDF417 (this is not the same PDF as the file format from adobe). Such a format is a bit more complex than QR Code with using a base 929 encoding of the data.
@bitman @blinry @piko
Said PDF417 is used by quite a few governments for government ID data, including "RealID" by US Homeland Security on US driving licences and Israel uses it on their visa documents. It is a format designed for being read by uncordinated linear scan rather than image sensor. I doubt the image is actually stored on the card in that data, but a reference to where to find the image in government database.

@ewanm89 @blinry @piko oh, I see where the confusion might be coming from, as OLDER versions of the INE card USED PDF417, however, newer ones use two high-density QR codes on the back, and there's even an official app from the Electoral Authority to read and validate IDs by scanning said codes, which results in the full name and other data of the holder, as well as a color picture.

Here's is a link to both versions of the app. You might find a specimen going around, but after scanning it, it says is invalid. I also tried using the official app WITHOUT any sort internet connection and it worked just fine, meaning the data is indeed contain within those QR codes to the best of my understanding:

Apple App Store: https://apps.apple.com/mx/app/valida-ine-qr/id1515385147

Google Play Store: https://play.google.com/store/apps/details?id=mx.ine.rfe.lectorqr&pli=1

Newspaper talking about it and specimen with QR codes: https://www.eluniversal.com.mx/nacion/politica/ine-nueva-credencial-para-votar-con-codigos-qr-para-verificar-datos/

If you want a real ID to be able to scan the codes, PM me and I'll *see what I can do.

‎Valida INE-QR

‎Valida INE-QR, es una app desarrollada por el Instituto Nacional Electoral (INE), que permite a la ciudadanía la lectura y verificación de los códigos QR de la Credencial para Votar que hayan sido emitidas a partir de diciembre de 2019, la correcta lectura e interpretación mostrará información conte…

App Store
@blinry @piko very cool dynamic tutorial!
Excellent. 👌👏💡Thanks.
Qrcodes tuned out to be more complex that what I would have thought. Especially the zigzag reading order! 🤔
#computerscience #unpluged
@blinry @piko thank you for publishing - we ttied to attend the workshop but it was already full
@blinry @piko Yes well, in times gone by I could read paper tape, and on a good day punched cards, but I'm not looking to revive those skills.
@blinry @piko Awesome page!
And I might use it as a neat reference/optional PR target to make this codec in calculang! Thanks for sharing!
@blinry @piko im so very gladd someone else is aware of gur potential of human created and human readable 21x21 QR codes! :D
@blinry @piko this was a really cool read!

@blinry @piko

This is fabulously well done, thank you! ❤️

I had to slog through tons of materials to figure this out a few years' back for a dissertation-adjacent project* but never did manage to figure out masking manually, so ended up using a generator for the final pattern.

*made a QR code of my dissertation research question in Miyuki seed beads. Still haven't finished as it takes a LONG time! 😀

@blinry @piko I'll take "Questions that begin with 'Why'" for $200 Alex.
@blinry @piko also, at least on iPhone if you take a screenshot that has a QR code in it the code becomes a clickable link in the photos app. Not sure if that’s true on android too. That’s why I’ve been slathering qrs in all my shorts and Insta posts. It’s a handy way to be like “I want to check that link out later”.

@blinry @piko

Leave it to me to break it. ;)

The page does well up to 42 ascii characters, but any more than that (checked up to 45) it lists the length as 37 and decodes the first two letters that it shows incorrectly. It's when it goes from version 3 to version 4.

Thank you for this! You gave me a good start. Now I have to dig more deeply into it.

@blinry @piko I just did a quick read over it, but didn't see the block interleaving - did I miss that or is that actually missing?
@blinry @piko wHY DID IT PICK UP HENTAI AS A RANDOM ENGLISH WORD I?????????????????
@blinry is there a recording of your workshop from #37c3 available? Couldn’t find on on media.ccc.de…
@leuschner @blinry I don't think so. It was hold in a workshop room and we even moved to a different place. I haven't seen a camera. Also they did some practical training. But maybe on the next congress you can make a talk of it. I found it very interesting and as there where a lot of people interested at 37C3 as well, it's probably a good idea to have a recorded version.
@blinry @piko Thank you! I was always curious to know how these worked. It looks very fragile, even with error correction (eg a blob of dirt over the mask pattern bits)

@marinheiro @blinry Yes, that's why there are actually two places for the mask pattern bits. And it still seems to work if both are covered! 🤨 (I tried it just now :D)

I think there's still so much more to the error correction (which would be too much effort to do it completely in your head) that it somehow is really stable...

@blinry @piko …Who needs to read QR codes manually so often that they developed mnemonics for the masks?
@blinry @piko first you made an amazing explanation of git, and now you made an amazing explanation of qr codes...

@blinry @piko
You use bytes to store alphanumeric data ?

Because I made a QR Code watchface for the Watchy (https://github.com/Cqoicebordel/Watchfaces/tree/main/QR_Watchface), and I guarantee trying to decode alphanum data on paper or in your head is hard, each char use 5½ bits.
Guaranteed headache.

All that to say, it would have been funnier to use alphanumeric encoding ;)

Watchfaces/QR_Watchface at main · Cqoicebordel/Watchfaces

A few watchfaces for the Watchy watch. Contribute to Cqoicebordel/Watchfaces development by creating an account on GitHub.

GitHub
@blinry
Uhh, really not what it is for, but think about doing a#CPP #mdspan iterator to do this 😳
@piko @vitaut
Netzfund: QR-Codes ohne Computer lesen - Golem.de

QR-Codes von Hand zu dekodieren mag zwar unpraktisch sein, eine spannende Erfahrung ist es aber dennoch. Wie das geht, erklären zwei Entwickler.

Golem.de
@blinry @piko Nice explainer!
One comment: In the vertical formatting information line, the 8th bit from the bottom doesn't belong to it according to your drawing, but it's not a data bit either. What is there?
@blinry @piko or they ould just hand me a freaking menu at the restaurant already
@blinry @piko

We had a bug with bringup of a sync serial interface, and ended up reading the data off a memory scope to see why it wasn't sending reliably. There were like four of us, so that was probably the most expensive USART implementation of all time.

(Turned out it wasn't getting the clock, and trying to PLL against the bit stream. If it stayed in one state long enough it would drift enough to mis-clock a bit.)
@blinry @piko This is so cool!! I got partway through building something like this a while back, I'll definitely have to dig into the code and check it out 😃​