Site hosted by Angelfire.com: Build your free website today!

Easy secure comm's over a network

    Home

    Portfolio
     3D Art/Animation
     Programming

    Tutorials
     3D Art/Animation
     Programming

    Work In Progress
     The Interview
     Ex-Smokers logos
     Programming

    About Me



     Free Domain Name - www.YOU.co.nr

Using the XOR encryption detailed in a previous tutorial (click here) we can securely send information over a network, including the internet.
At first inspection, it would appear that the easiest method for this secure communication would be to have both parties knowing the key string. However, this leads us to two problems

  1. If both parties know the key to encrypt and decrypt the data, the security of the communication has just been halved. It is more likely that someone will accidentally leak information if more people know that information.
  2. If the key is leaked and then needs to be changed, or if the key is changed on a regular basis to improve security, it needs to be changed at both ends. This not only doubles the work, but can also make it very complex, particularly if there are multiple machines accessing data on each other.

The solution to this problem is remarkably simple. Due to the nature of XOR encryption, and the fact that the same routine is used to encrypt and decrypt the data, we can use a method I refer to has dual encryption.

If you look at the diagram on the right, it may help to clarify the process.
The computer sending the data is Computer A and the computer receiving the data is Computer B. The process is in four steps, as follows:

  1. Computer A, using its own unique key, encrypts the data and then sends it to Computer B.
  2. Computer B does not know Computer A's key, but it does have it's own, so it then encrypts the data again, but using its own key. This is why I call this method dual encryption. The data is then passed back to Computer A.
  3. Computer A now has the dual encrypted data, but does not know Computer B's encryption key. However, because of the encryption/decryption method used, running the data through the encryption routine again, using Computer A's key will now remove Computer A's encryption from the data. This leave's us with data that has now only been encrypted by Computer B. The data is then passed back to Computer B.
  4. Computer B now has the data that it can run through the encryption routine, using it's own key again. This will now remove all encryption from the data, restoring it to it's original form.

As you can see, this method requires that no-one need know anybody else's encryption key. In fact, you may change your own key as often as you like to ensure security.

Unfortunately, there is a down side to this method. Because the data is being transmitted three times, it obviously takes three times as long to reach the final destination. This means that this method can effectively only be used over a very fast network connection, or on small amounts of data.
 

Previous tutorial Next tutorial