1
$\begingroup$

For example, the text is something like

"Hello world!"

And after that text should be new line with hash (sha256):

9e77bdb7b7b67bee57fe10946ac0275e38585c688ace439d96d82ebf71c26496

So, now it is not possible to modify QR code (recoloring some squares) without loosing it.

Is something like this implemented for QR coding outside, where it is possible to modify the code?

$\endgroup$
  • 1
    $\begingroup$ QR codes already do make use of error-correcting codes, if that's what you are asking. $\endgroup$ – yyyyyyy Jul 25 at 14:15
  • $\begingroup$ What's your actual goal here? There are several ways in which one could detect unauthorized modifications to a piece of data (none of which, AFAIK, are specific to QR codes), but the details depend on what you want. For example, do you want anyone to be able to read the code and detect any possible modifications, or is it enough if only people who know a specific secret key can do that (and can also create new codes or modify them)? $\endgroup$ – Ilmari Karonen Jul 25 at 15:59
  • 1
    $\begingroup$ In any case, entirely preventing modifications seems impossible: for example, someone could just cover the original code with a sticker bearing a new one (or even a copy of another valid code). The best you could do would be to digitally sign the data encoded in the code, allowing anyone who reads it (and knows your public key) to verify that it has been signed with your private key. $\endgroup$ – Ilmari Karonen Jul 25 at 16:02
  • 1
    $\begingroup$ It doesn't prevent tampering. Anyone that can verify the hash can also compute the hash of a different message. At best you could detect accidental corruption, and that scenario is already covered by error correction codes. (Redundancy in the pattern which can be used to recover data even if part of the QR code is corrupted or misread.) $\endgroup$ – Future Security Jul 25 at 17:52
3
$\begingroup$

There are encrypted QR codes from DENSO ADC. I know that these can be encrypted or just signed; however, DENSO ADC has never been forthcoming with how they work. They seem to work by putting data after the "data section" of the QR code that would otherwise be ignored. If you were going to have something similar, I would take that approach.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.