
Two basic articles on visual cryptography:
One interesting thing about this schema is that can be applied for stenography and can be simply implemented physically using only shadows.
Update: a shorter explanation with examples.
See too: One Time Pad Using Gimp.
With a ∈ {0,1} and b ∈ {0,1}, the XOR function {0,1}→{0,1} can be defined by the truth table:
| a | b | a XOR b |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Gimp doesn’t have a layer operation called XOR but there is the “Difference” mode defined by the Gimp User Manual by the equation:
$latex E =|I – M|$
Applying the formula to the Red Green Blue color mode for a pixel we have:
$latex rgb(|r_I-r_M|,|g_I-g_M|,|b_I-b_M|) =|rgb(r_I,g_I,b_I) – rgb(r_M,g_M,b_M)|$
The truth table for the “difference” mode is:
| I | M | |I – M| |
| rgb(0,0,0) | rgb(0,0,0) | rgb(0,0,0) |
| rgb(0,0,0) | rgb(255,255,255) | rgb(255,255,255) |
| rgb(255,255,255) | rgb(0,0,0) | rgb(255,255,255) |
| rgb(255,255,255) | rgb(255,255,255) | rgb(0,0,0) |
Let’s call black-white representation this binary pallet:
Then the truth table for the difference is the same as the XOR one.
Let A_0101.png be this image:

And B_0011.png be this image:

Notice that each image use the black-white representation of the binary message in the file name.
After we apply the “Difference” layer mode with the two images we have what we can call AXORB_0110.png:

Let message.png be this 512×512 image using a 1-bit pallet (Lena with Floyd–Steinberg dithering):

And key.png a image of the same size and pallet with random content:

We can create a image messageXORkey.png using the Gimp’s different mode:

The messageXORkey.png looks as random as the key or any other random key.
Someone in possession of messageXORkey.png and key.png can apply a XOR to retrieve message.png. That’s because:
messageXORkey.png = message.png XOR key.png
messageXORkey.png XOR key.png = message.png XOR key.png XOR key.png
messageXORkey.png XOR key.png = message.png XOR 0
messageXORkey.png XOR key.png = message.png
This was a demonstration of how to use GIMP to encode and decode one-time pads. There are several constraints to use one-time pads in a secure way for practical purposes that you should know before using it in a real situation.
Can I have a secret?
Can I tell you a secret?
Can I tell you a secret when we know there is someone snooping around?
I’d like to share this graphical explanation of the Diffie-Hellman key exchange principle without going into the details about the math behind it. It uses physical abstractions as padlocks, keys, and treasure chests. The goal of the key exchange is to allow two parties to establish a shared secret key over an insecure communication channel.


Let’s (very) informally define computationally efficient as a computation that someone is willing to wait and pay.
The abstraction here is that a chest with padlock is easy to lock/unlock when you have the correct key but hard to be unlocked otherwise. To use this technique with data, we need a mathematical function f that is:
If you want to know more about these functions, take a look in the original article “New directions in cryptography” by Diffie, W. and Hellman, M. in 1976.

Gpg is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool to provide digital encryption and signing services using the OpenPGP standard.
To easily encrypt a file called mydocs use:
gpg -c mydocs
You’ll be propted twice for a password, after that a encrypted file called mydocs.gpg is created. You can send this file to your it’s destine and send the password using some secure way. In the other side to decrypt the file:
gpg mydocs.gpg
That’s a very simple use of this tool, you can do much more.