Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI option for mask pattern #192

Open
lenoleno opened this issue Dec 7, 2021 · 3 comments
Open

CLI option for mask pattern #192

lenoleno opened this issue Dec 7, 2021 · 3 comments

Comments

@lenoleno
Copy link

lenoleno commented Dec 7, 2021

I suggest adding a command-line option to qrencode that lets the user decide on the mask pattern used for the generated QR code.

Use-case is the digital replication and further processing (print) of a QR code given in analogue form (on paper). It is easy to read the information encoded in a given QR code and then re-generate a new QR code. Though, both QR code generators may decide on different mask patterns leading to visually different QR codes. For whatever reasons this can happen anyway, as long as you have no control over the software generating the original QR code, there's no other way to prevent this than to choose the mask pattern manually (which can be read-off a QR code manually).

While, in many settings, different QR codes encoding the same information are not much of a problem, things get a bit more complicated when a QR code is used as an official document (containing signed data) given out by administration or some other "official" institution. Referring to an "obviously fake" QR code may put you in a legally weak position, if parties are not able or willing to check validity of your QR code.

Thank you for considering this. And thank you for the qrencode software!

@lefuturiste
Copy link

I think the default mask for this lib is 101 (cf. https://blog.qartis.com/decoding-small-qr-codes-by-hand/photos/thumbnails/qr-mask.png)

@jan-slupski
Copy link

Also looking for that option. Some online tools expose the mask choice but would be so handy to have it in a standard tool. Thanks!

@PSLLSP
Copy link

PSLLSP commented Jan 21, 2024

I tried to generate several QR codes with qrencode and it seems there is no default mask pattern, like generator randomly selects mask pattern. Maybe it is not random but optimal pattern; when I create the same QR code again and again, it has the same pattern but when I try different data, I see different mask pattern is used for each QR...

qrencode -l M -t utf8 'testX' and replace X with other character, like digits 0-9 or anything else. Just a small change to data and the generated QR will have different mask pattern...

$ qrencode  -V
qrencode version 4.1.1
Copyright (C) 2006-2017 Kentaro Fukuchi

QR-test-X

Screenshots from QRazyBox

QR-ECC-M-0a
QR-ECC-M-1a
QR-ECC-M-2a
QR-ECC-M-3a
QR-ECC-M-4a
QR-ECC-M-5a
QR-ECC-M-6a
QR-ECC-M-7a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants