PDA

View Full Version : Need Suggestion : Making a Unique QR Code



Frdz
27th August 2015, 22:34
Hi there,
I start to learn about QRCode in Qt using existing library provided by QZXing Project (http://sourceforge.net/p/qzxing/wiki/Home/) and succesfully implemented standard QRCode encoder/decoder. My problem was to create unique QRCode that only understandable by my system environment. So I need your suggestion how to realize that.

GOAL : Create unique QRCode, can not be regenerated using standard/conventional QRCode encoder. Except copy machine.

LIMITATION : BW image color, No new library creation (since I just can create something like "Hello World" library, no more :o ), small modify in QZXing lib is OK.

So that's all, don't hesitate to post your idea here I'll consider all possible solutions of yours. Extreme idea also approved :rolleyes:
Thank you in advance,
xfrdzx ^^

ChrisW67
28th August 2015, 11:35
I do not see any reason to reinvent the QR Code of the libraries that can render one for you. If you need a custom data payload that is tamper resistant then use a byte encoded form of QR Code, encrypt your payload and/or protect integrity with an HMAC or similar.

Frdz
29th August 2015, 00:53
Firstly I thank you for your response ChrisW67,
This is my first time hear about HMAC, I'll check it soon.
Thinking about using encryption, did you mean an encryption with secret & public key where the public key used to create the QRCode? If so, if there's any intruder(s), they still can read the public key using standard QRDecoder even they don't know what the data means inside, and can reproduce the same image based on that public key. CMIIW
Things that I want is something like this : Suppose your apartment keycard using QRCode (instead of RFID or similar in fact), if someone with bad intention take a pict of your card and intend to make the replica, they will fail due to get incorrect data while read it using standard QRDecoder and they will get different image while trying to encode those incorrect data.
I have restrain my problem scope to only ruin the standard reader/decoder itself while reading the code.
Something ever occured in my head is :
- Reordering the matrix, if it consist
- Add additional pixel into the encoded image
- Rearrange the 3 corner boxes with strange positioning
- Make my own model (something like QString::toQByteArray::toQMatrix::toQImage), but thinking the next decoding just make me crazy :D (corner detection, turned position, etc.)
Since I'm not finished yet in understanding QZXing technique, IDK which ways will work & easier to do. Just hope someone here experiencing with this can show me the easier ways.

ChrisW67
29th August 2015, 11:48
Suppose your apartment keycard using QRCode (instead of RFID or similar in fact), if someone with bad intention take a pict of your card and intend to make the replica
Then they already have a perfect replica of the original. They do not need to read, decode or re-encode the data: just print a copy of the image... or even just show the image on the screen of their camera to the reader.

If you are wanting to write a deliberately corrupted QR image then you could mangle the Reed-Solomon error correction bits in a way known only to your reader. These bits sit mostly adjacent to, and between, top- and bottom-left alignment blocks.

Frdz
29th August 2015, 20:30
Then they already have a perfect replica of the original. They do not need to read, decode or re-encode the data: just print a copy of the image... or even just show the image on the screen of their camera to the reader.
Yes, you're right. I can manage it outside of my program. Thats why I placed it as exception in my first post.
And what I struggling now is to double my security. Closing as many as holes for hacking posibbilities.


If you are wanting to write a deliberately corrupted QR image then you could mangle the Reed-Solomon error correction bits in a way known only to your reader. These bits sit mostly adjacent to, and between, top- and bottom-left alignment blocks.
Yeah, seems like what I'm looking for.
Really appreciated of your help, man! Many thanks :)