TEA (Tiny Encryption Algorithm)

Computer security has always been very important, now we are going to talk about TEA (Tiny Encryption Algorithm), developed by David Wheeler and Roger Needham at the Comuter Laboratory of Cambridge University.
One of his uses is on irc-hispano.org (Spanish main IRC servers) to encrypth the users IP to preserve users identity. It's very simple and easy to understand.
Here it'is the tow main functions source code: encipher and decipher
void encipher(const unsigned long *const v,unsigned long *const w,
   const unsigned long * const k)
   register unsigned long       y=v[0],z=v[1],sum=0,delta=0x9E3779B9,

      sum += delta;
      y += (z << 4)+a ^ z+sum ^ (z >> 5)+b;
      z += (y << 4)+c ^ y+sum ^ (y >> 5)+d;

   w[0]=y; w[1]=z;

War Games Film WOPR Computer
void decipher(const unsigned long *const v,unsigned long *const w,
   const unsigned long * const k)
   register unsigned long       y=v[0],z=v[1],sum=0xC6EF3720,

   /* sum = delta<<5, in general sum = delta * n */

      z -= (y << 4)+c ^ y+sum ^ (y >> 5)+d;
      y -= (z << 4)+a ^ z+sum ^ (z >> 5)+b;
      sum -= delta;
   w[0]=y; w[1]=z;

War Games film, launch codes


Takes 64 bits of data in v[0] and v[1].
Returns 64 bits of data in w[0] and w[1].
Takes 128 bits of key in k[0] - k[3].

encipher procedure

v is the data to encrypted (input), w is the encrypted data (output), k is the secret key (like a  password).

decipher procedure

v is the data to decipher (input), w is the deciphered data (output), the source data, k is the secret key.

n is the number of iterations

On irc-hispano.org, a brute force attack could be performed by a malicius individual by trying to guess the key.
Knowing your own IP and your encrypted IP given to you once inside the irc-hispano, you could try it.
The needed computing time to try on all the 128 bits key is too much for a home computer (today) but an organized distributed attack using about 50 home computers could have a chance to do it on a acceptable time.


This is a good algorithm to use on irc servers it's fast and portable
by Necro_
by DrDoom