News for hackers. Stuff that matters.
Re:Encoding your WiFi access point password into a QR code by AmericanChopper on Sunday December 29, 2019 @06:10AM (#21905325)
They can’t be used to encode very much data though. They wouldn’t be suitable for storing documents, but could be used to store the location of a document. I was trying to be clever once and thought I could encode X.509 certificates in QR codes. Even that much data was pushing the hard limits of what they can store, and became very hard to scan (I quickly realised this wasn’t actually very clever).
Re:Encoding your WiFi access point password into a QR code by BiteCode_dev on Sunday December 29, 2019 @06:26AM (#21905361)
7kb for a supermarket bill is plenty, and you can have several of them.

Forms and legal documents should all have an immutable official url and uuid anyway to point to their legal and administrative context.

Re:Encoding your WiFi access point password into a QR code by michaelt on Sunday December 29, 2019 @10:43AM (#21906434)
The largest QR code in the standard, "version 40" - can only store 3 kilobytes at the lowest level of error correction and 1.2 kilobytes at the highest level [1]. And that's a pretty huge QR code [2]

My back-of-the-envelope calculations say you'd need 61 bits per line on a receipt just to encode UPC, quantity and price. So the largest QR code would only allow 19-50 lines. And that's without including data like the store name, special offers, means of payment and so on. Believe me, plenty of people buy more than 50 items in their supermarket christmas shop :)

Standardised digital receipts would be neat but, QR codes encoding the data ain't the way to go about it.

[1] https://www.qrcode.com/en/about/version.html [2] https://commons.wikimedia.org/wiki/File:Qr-code-ver-40.svg

Re:Encoding your WiFi access point password into a QR code by jlgaddis on Sunday December 29, 2019 @02:31PM (#21907908)
Seems like the obvious thing would be to have the QR code contain a "receipt ID" (UUID?) in a URL.

When the QR code is scanned, the browser opens to the URL, the remote side takes your "receipt ID", and presents you with a list of all the items you purchased.

I can't imagine any decent-sized retailer isn't already maintaining records like this.

Re:Encoding your WiFi access point password into a QR code by naniwaduni on Sunday December 29, 2019 @05:21PM (#21908993)
See, one of the useful properties of a paper receipt is that, once you receive it, you can be fairly confident about the ~one way you're going to lose it
Re:Encoding your WiFi access point password into a QR code by jmiserez on Monday December 30, 2019 @10:32AM (#21913951)
Two ways. Receipts fade, sometimes very quickly.
Re:Encoding your WiFi access point password into a QR code by tzs on Sunday December 29, 2019 @11:08PM (#21910741)
1.2 kilobytes = 9.6 kilobits. If you need 61 bits per line, you’ve got enough bits for 157 lines. 393 lines if we go with 3 kilobytes. I think you may have used 61 bytes per line in your calculation rather than 61 bits.
Re:Encoding your WiFi access point password into a QR code by colejohnson66 on Monday December 30, 2019 @11:48PM (#21919028)
I (not OP) would say bytes would be closer. The product name could be 20 characters long (20 bytes minimum)
Re:Encoding your WiFi access point password into a QR code by tzs on Tuesday December 31, 2019 @01:51AM (#21919422)
OP was assuming the receipt would list the product UPC code rather than product name. A UPC code is 12 digits, which can be encoded in 40 bits.
Re:Encoding your WiFi access point password into a QR code by smegger001 on Sunday December 29, 2019 @12:16PM (#21907040)
it could just contain a url linking to a page with to content.
Re:Encoding your WiFi access point password into a QR code by m-p-3 on Sunday December 29, 2019 @08:28AM (#21905770)
I wish we could encode PGP public keys with them, but it's still too much data.

That would be a neat way of exchanging a key.

Re:Encoding your WiFi access point password into a QR code by StavrosK on Sunday December 29, 2019 @08:35AM (#21905807)
You can definitely encode ed25519 keys to a QR code.
Re:Encoding your WiFi access point password into a QR code by prepend on Sunday December 29, 2019 @08:57AM (#21905882)
How big is your pgp public key? Mine is under 4K in ascii and can definitely fit in a QR code.

If you use a crypto atm it will print out your wallet’s private and sometimes public keys as QR codes.

Re:Encoding your WiFi access point password into a QR code by AmericanChopper on Sunday December 29, 2019 @05:54PM (#21909186)
4K is around the point where some devices will start to have issues scanning. Also, crypto wallets won’t usually give you the private key, instead they’ll give you the 12 word BIP39 seed phrase which will be around 70-80 bytes.
Re:Encoding your WiFi access point password into a QR code by BiteCode_dev on Sunday December 29, 2019 @09:02AM (#21905900)
Gpg key fingerprints are very small though and can be used for that.
Re:Encoding your WiFi access point password into a QR code by elcritch on Sunday December 29, 2019 @06:22AM (#21905350)
Can X.509 ceros use elliptic curve? They’d be much smaller.
Re:Encoding your WiFi access point password into a QR code by AmericanChopper on Sunday December 29, 2019 @06:30AM (#21905374)
Even without the key they start to look pretty dense. You can definitely fit one in a QR code, they just start to become less reliable to scan (especially on cheap devices), and they go from looking nice to looking quite ugly. Technically most X.509 certs would have been within the limitations of QR codes (though I don’t think there is an upper bound to how large they can get), but I realized it just wasn’t fit for purpose and moved on to something else.
Re:Encoding your WiFi access point password into a QR code by matheusmoreira on Tuesday December 31, 2019 @07:23AM (#21920548)
Are you using 8 bit encoding? An alphanumeric mode QR code containing base 64 encoded data provides less capacity. In binary mode even a 4096 bit RSA secret key fits while ECC keys produce smaller codes.

The qrencode tool has an 8 bit mode but not all decoders can handle binary data. For example, my phone shows me mangled results and I can't redirect them to a file. Like structured append, it doesn't seem to have much support.

I've sent patches to ZBar improving this:

https://github.com/mchehab/zbar/pull/64

Hopefully it will make QR codes more useful for storing keys and other small files.

Re:Encoding your WiFi access point password into a QR code by slim on Sunday December 29, 2019 @07:30AM (#21905555)
i think datamatrix is more suitable for x509
Re:Encoding your WiFi access point password into a QR code by other_herbert on Sunday December 29, 2019 @10:17AM (#21906269)
Yes.. I had made a form that was scanned and all the metadata for the page was stored in datamatrix at the bottom.. With a laser printer and a good scanner you can reliably put a lot of data in there...