QR-Inking
One dot of ink, and the poster sends you to a different website.
MIT licensed · runs entirely in your browser
A normal QR code is not one dot from a lookalike. The error correction keeps real codes far apart on purpose. The trick is a specially printed boundary code that already sits on the edge. One dot then tips it over. You can prove both halves below, and then make a harder-to-attack code for your own link.
Paint the dots. Watch the website change.
Pick a example, then paint the marked squares (or press flip). A real QR reader in your browser reads a different site the moment the last dot lands. Switch to a normal code to see the same dots do nothing.
Paint the 3 marked squares. Watch google.com become google.cam.
The printed symbol, untouched. It scans as the real host.
This scan is already at its repair limit, aimed at one neighbour. A scanner should flag that.
row 3, column 15. light
Click or drag the code to toggle squares. Use arrow keys and space for precise edits.
Type any site and rank every conflict.
The same engine, pointed at a whole host. Type a URL, choose a version, level and direction, and see every same-length neighbour ordered by how few dots it costs.
level M is medium (15%) recovery. mask 0 is one of eight print patterns; it moves the module and can swap add ink for remove ink.
module at row 15, column 15. scratch one dot off.
The printed symbol is a boundary symbol. It already carries 8 corrected errors toward the neighbour, so it still reads as the real host.
The honest part: on a normal QR for this host, flipping that same module does nothing. It still reads google.com. The attack is the printed boundary symbol, not the dot.
Make your own QR harder to attack.
Paste your link and download a safer version. It is built so no single dot can change where it points, and so you can check your own print. Then the checklist shows what scanners, publishers, and registries can each do.
The address your QR code should open.
One dot could turn this into a look-alike.
Now it takes at least two dots, not one.
Why it is safer: this code is built so no single dot of ink can change where it points. The cheapest tampering needs two dots, and you can check your own print before you use it.
Honest caveat: this raises the bar, it is not full protection. The strongest defense is a scanner that flags a tampered code, in the checklist below.
look-alike addresses sit one dot from your normal code
sit one dot from your safer code (the cheapest needs two)
how this works (optional)
A QR code carries spare data so it still scans when it is dirty. The attack prints a code that has used up almost all of that spare room toward a look-alike, so one more dot tips it over. How far apart two codes sit depends on the number of error-correction symbols.
When that number is even, the minimum gap lets a single symbol (often one dot) cross it. When it is odd, the minimum gap is one wider, so the cheapest edit needs two. The safer code picks the smallest standard size with an odd count. For your link that is version 3 level L (15 correction symbols), versus the normal version 2 level M (16).
The full construction and limits are in the paper (PDF).
A tampered code gives itself away. An untouched code needs zero repair to scan. The attack code is already at its repair limit, aimed at one neighbour. You can watch this live in the demo above: switch between normal and boundary and see the repair meter jump from zero to the flag line. A scanner that checks this catches the attack even when the printed code cannot be changed. Moving the text around is not a defense, because the attacker simply picks a different neighbour.
What each side can do
- Flag any clean scan that had to repair a lot, at or near the code's repair limit. An untouched code needs zero repair.
- Flip each data square and read again. The one square that changes the website is the tell.
- Show the decoded website and ask the person to confirm before opening it.
- Check that your printed code scans with zero repair. Any repair on a fresh print means it was tampered with.
- Use the safer size above (an odd number of correction symbols) so one dot is never enough.
- For high-stakes codes, control the physical copy: laminate it, add a tamper seal, do not let stickers go over it.
- Treat the same-length neighbours of your domain, especially the look-alike endings, as attack surface.
- Monitor those names, and defensively register the ones closest to yours.
- The generator above shows how many sit one or two dots from your code.
The paper and the code.
Everything here is measured and reproducible. Read the construction in full, or clone it and run every number yourself.
The boundary construction, the sweep across every top-level domain in the IANA root, validation on real readers, and the detection that comes with it.
The Reed-Solomon boundary construction, the full TLD sweep, and the validation harness. Clone it and reproduce every number in the paper.
