Reputation: 8124
I'm looking for the logic to decrypt (not only decode) QR Codes. Recently I have seen several applications that encrypt QR codes like QuickMark. For example this QR decrypts to "StackOverflow" with the password "pass":
I you use a normal QR Reader without decryption we get (this is the actual output of the QR above):
PE:r������Q�\�9:
Whats the login behind encrypting and decrypting QR Codes?
Is there a code sample or library (in any language or pseudo-code) that already performs these operations?
From my research I've found that the encryption is not simply achieved by running a cryptographic function like SHA and simply encoding that into a QR... I have tried unencrypting the content "r������Q�\�9:" (without the PE:) with tools like this Online Encrypt Decrypt String and with several algorithms, using the passphrase "pass" but I can't see the text "StackOverflow".
Upvotes: 3
Views: 11680
Reputation: 112857
From QR Encryption: Encrypted QR codes, which are not very common, have a few implementations. An Android app, for example, manages encryption and decryption of QR codes using the DES algorithm (56 bits).
You will need to know the encryption password or key. The only hope is a simple/common password for a brute-force attack, other than that the there is little hope to decrypt the data, even though DES is a weak algorithm.
SHA* is not encryption, it is a cryptographic hash code which are one-way functions, that is there is no way to un-scramble them back to the original.
Encryption is used to allow those authorized to have access. The Japanese immigration system uses encrypted QR codes when issuing visa in passports.
Upvotes: 2