The Tiny Encryption Algorithm

From: rja14@cl.cam.ac.uk (Ross Anderson)
Newsgroups: sci.crypt.research
Subject: Re: Need a good algorithm for tiny spaces
Date: 22 Feb 1995 12:12:37 GMT
Organization: U of Cambridge Computer Lab, UK
Message-ID: <3if9nl$1kj@net.auckland.ac.nz>
Reply-To: rja14@cl.cam.ac.uk (Ross Anderson)

In article <3hrbis$jcu@paganini.sydney.sterling.com>, wmoyes@cello.gina.calstate.edu (William A Moyes) writes:

> I am in need of a strong encryption algorithm that requires very
> little storage for buffers and key expansion tables (<32 bytes RAM).

An algorithm designed for this purpose is TEA, the Tiny Encryption Algorithm from David Wheeler. It was presented at last year's fast software encryption workshop at Leuven, and here is a description of it from my lecture notes. Incidentally, would the fact that this code is in LaTex readable rather than directly compilable form make it exportable from the USA? ;-) [Mostly de-LaTexed in the process of HTMLizing. -- @Man]

Ross

TEA

The Tiny Encryption Algorithm, or TEA, is a Feistel cipher invented by David Wheeler. It is intended for use in applications where code size is at a premium, or where it is necessary for someone to remember the algorithm and code it on an arbitrary machine at a later time.

The round function is based on a shift and add operation, with the carry bit providing the nonlinearity. The golden ratio $\frac{\sqrt{5}-1}{2}$ is added in every second round to prevent chosen plaintext attacks (can you see why?). The official specification is given in C and is:

 
void code(long* v, long* k) 
{ 
    unsigned long y=v[0],z=v[1],sum=0,      /* set up */
                  delta=0x9e3779b9, n=32 ;  /* key schedule constant*/

    while (n-->0) 
    {                                       /* basic cycle start */
        sum += delta;
        y += (z<<4)+k[0] ^ z+sum ^ (z>>5)+k[1];
        z += (y<<4)+k[2] ^ y+sum ^ (y>>5)+k[3]; /* end cycle */
    }
    v[0]=y; v[1]=z;

}
Since its round function is relatively weak, with nonlinearity coming only from the carry propagation, TEA has 64 rounds. However, its simplicity means that it runs more quickly in software than many other algorithms with fewer, more complex, rounds.
@Man, World-Class Data Snuggler / First Interskate Productions / atman@ecst.csuchico.edu

Back to @Man's Homepage