QR Codes are a two-dimensional type of matrix barcode that are used for a variety of uses. They’re one way of turning a long piece of string data into an easily machine-readable format. For this reason, they can be used to store private keys for encryption and crypto-currency purposes. [Roger Ver] attempted to use a QR code containing a private key to give away some cryptocurrency on TV, but the code was blurred out by the broadcaster. Not ones to give up easily, [Michael] and [Clément] decided to see if they could reconstruct it anyway.
The work begins, as so many cryptographic exploits do, with the collection of as much of the plaintext key as possible. By stepping through the footage frame by frame, small pieces of the unobscured QR code were found, as well as some of the private key itself. By combining this with enhanced images of the blurred code, the team were able to put together less than one third of the QR code. The team had other tricks up their sleeve though – they knew the QR contained a private key of a particular format, and were able to figure out the QR code was 41×41 pixels.
By using this data along with a careful study of the QR code format, the team were able to put together some code in Python to brute force the key. After 838849 trials, the key was found, and the team were able to claim the prize. It’s a great example of cryptographic analysis – and so is this story on hacking your own password.
[Thanks to Esko for the tip!]
4 thoughts on “Reconstructing A Blurry QR Code”
Now tv series and movies should take these posts as inspiration and keep it to this. “enhance”, “rotate” and “reflection” haha nice.
God damned fascinating, with a great payoff at the end for the people who did it. Thanks for the read!
Very telling of Bitcoin was this part: “The process to redeem the BCH wasn’t as easy as scanning the QR code on TV but it was challenging and fun.”
Mike from HSBNE (hackerspace Brisbane) Did a qr code with their logo flame on a chip
Please be kind and respectful to help make the comments section excellent. (Comment Policy)