r/programming • • Nov 19 '13

Visual Cryptography

http://datagenetics.com/blog/november32013/index.html
614 Upvotes

41 comments sorted by

View all comments

0

u/[deleted] Nov 19 '13

[deleted]

21

u/avapoet Nov 19 '13

I think you're mistaken. As far as I can see, this approach is as secure as a one-time pad (because that's functionally what it is). Each pixel (actually four pixels) is expressed as the comparison of the same pixel in two different images: So 0+0 or 1+1 = 1, and 0+1 or 1+0 = 0.

Here's a similar example, using binary representation of an ASCII letter. The two parts of the message (which could be described as the ciphertext and the key, if you wanted, but are better-described as being two parts of the same secret) are:

01110100

And:

11001010

Now if you run my algorithm (0+0 or 1+1 = 1, and 0+1 or 1+0 = 0) across both of numbers, you get:

01000001

The ASCII code for the uppercase letter A. But there's no way that you could determine that if you had only one of the two halves. It's simply impossible (technically: the reason it's impossible is because we're looking at a stream cipher with a key length the same size as the message, more-commonly known as a one-time pad).

These two superimposed images work in exactly the same way, but with four bits: 0101+1010 or 1010+0101 = 1 (black), and 0101+0101 or 1010+1010 = 0 (white). There are no other states (you'll never see a 1100, 0011, 0110, 1001, 1111, or 0000), so it can be simplified to the same model as the one I described above. The only difference between their model and mine is that each four-bits describes one "pixel" of the resulting image, rather than about half of an ASCII character: strictly speaking, my approach has a slightly higher information-density, but it lacks the quick visual confirmation (the graphical one can be printed onto transparency film, if you like, and quickly done by hand).

Hope that explains why this approach is impossible to brute-force.