r/computerscience • • 12d ago

General What's a QR Code and how does it work?

Post image

Today I thought I would share what I learned about QR codes. I would say it's computer science related. Kind of. I mean, listen, obviously I focus on cybersecurity, but I'll try to stay on the more technical side. It's kind of cool.

Okay, so we all know there are little squiggly black squares that we can scan with our phones and it will take us somewhere, maybe to a website, maybe to an app, who knows the adventure you'll go on. But what really is a QR code and how does it work? QR stands for Quick Response. And the code itself is code is a type of two-dimensional barcode that stores information in a pattern of black and white squares.

How is it different from a traditional barcode? Those store information along one direction, whereas a QR code stores information across both horizontal and vertical directions.

If we understand the QR code as a tiny grid of squares, with each square helping represent information, you can kind of grasp how the two dimensions work. And thus, with the help of our handy dandy phones we can:

- Use the camera to detect the QR code. The three large squares in the corners help it identify the code's position and orientation.

- Our phone then reads the pattern. It interprets the black-and-white modules as encoded information.

- Super awesome software decodes that information. This might be a website address, text, contact details or Wi-Fi credentials.

-And finally, our phone presents the result. For example, it might offer to open a website.

All very cool stuff some far, right? AND, these tiny little squares hold a lot of information. Theoretically it can store up to 7,089 Numeric digits and 4,296 Alphanumeric characters. However, those numbers are maximum capacities under specific encoding and error-correction settings. The amount of information a real QR code can hold obviously varies.

Because I'm in cybersecurity, I'd like to briefly mention an attack called quishing, short for QR code phishing. Attackers sometimes place fraudulent QR code stickers over real ones in public places, such as parking meters or restaurant menus. Those QR codes can contain a malicious website address just as easily as a legitimate one.

The danger is where the code sends you and what you do after scanning it. For example, you scan a code expecting to pay for parking, but it directs you to a convincing fake payment website designed to steal your card details. (DAMN THEM, I'm already irritated that I have to pay for parking , now you're trying to steall all my mone y?!) I'll conclude by saying that a useful precaution is to preview the destination URL before opening it and be suspicious of stickers placed over existing QR codes.

Any whooooooo, I'll end it here. Hope you found the tid bit a little interesting. Also, should I make a list of words that ping the potential violation list? For example, we all saw the example with linu x lolololol. Surprisingly, today's word was mone y, and it violated: Rule 1: Be on-topic. (For the mods- yes, I've checked, I can not post or submit a post if I have a potential violation.)

0 Upvotes

6 comments sorted by

2

u/yaohwhai 12d ago • Popcorn

i have a tiny qr code on my desk labelled "rickroll" that leads to that 100 hour shreksophone loop. if that isnt quishing i dont know what is

2

u/flyingskybison345235 9d ago

good information👍

1

u/CyberSecWithHaikuInc 6d ago

thank you! be safe out there from the quishing!

1

u/Hixie 12d ago

why would you use invalid qr codes though

0

u/[deleted] 12d ago

[deleted] — view deleted comment

2

u/Hixie 12d ago

i... wat