Tiny Encryption Algorithm
|
- This article is about the TEA encryption algorithm. For other meanings, see TEA (disambiguation).
In cryptography, the Tiny Encryption Algorithm (TEA) is a block cipher notable for its simplicity of description and implementation (typically a few lines of code). It was designed by David Wheeler and Roger Needham of the Cambridge Computer Laboratory, and first presented at the Fast Software Encryption workshop in 1994 (Wheeler and Needham, 1994). It is not subject to any patents.
Contents |
Properties
TEA operates on 64-bit blocks and uses a 128-bit key. It has a Feistel structure with a suggested 64 rounds, typically implemented in pairs termed cycles. It has an extremely simple key schedule, mixing all of the key material in exactly the same way for each cycle. Different multiples of a magic constant are used to prevent simple attacks based on the symmetry of the rounds.
TEA has a few weaknesses. Most notably, it suffers from equivalent keys — each key is equivalent to three others, and this means that the effective key size is only 126 bits (Kelsey et. al., 1996). This weakness led to a method for hacking Microsoft's Xbox game console, where the cipher was used as a hash function. TEA is also susceptible to a related-key attack which requires 223 chosen plaintexts under a related-key pair, with 232 time complexity (Kelsey et. al., 1997).
Because of these weaknesses, a number of revisions of TEA have been designed, including XTEA.
Reference code
Following is an adaptation of the reference encryption and decryption routines, released into the public domain by David Wheeler and Roger Needham:
void encrypt(unsigned long* v, unsigned long* k) { unsigned long v0=v[0], v1=v[1], sum=0, i; /* set up */ unsigned long delta=0x9e3779b9; /* a key schedule constant */ unsigned long k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += (v1<<4)+k0 ^ v1+sum ^ (v1>>5)+k1; v1 += (v0<<4)+k2 ^ v0+sum ^ (v0>>5)+k3; /* end cycle */ } v[0]=v0; v[1]=v1; } void decrypt(unsigned long* v, unsigned long* k) { unsigned long v0=v[0], v1=v[1], sum=0xC6EF3720, i; /* set up */ unsigned long delta=0x9e3779b9; /* a key schedule constant */ unsigned long k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for(i=0; i<32; i++) { /* basic cycle start */ v1 -= (v0 << 4)+k2 ^ v0+sum ^ (v0 >> 5)+k3; v0 -= (v1 << 4)+k0 ^ v1+sum ^ (v1 >> 5)+k1; sum -= delta; /* end cycle */ } v[0]=v0; v[1]=v1; }
References
- David J. Wheeler and Roger M. Needham. TEA, a tiny encryption algorithm. In Bart Preneel, editor, Fast Software Encryption: Second International Workshop, volume 1008 of Lecture Notes in Computer Science, pages 363-366, Leuven, Belgium, 14–16 December 1994.
- John Kelsey, Bruce Schneier, and David Wagner. Key-schedule cryptanalysis of IDEA, G-DES, GOST, SAFER, and Triple-DES. Lecture Notes in Computer Science, 1109: 237–251, 1996.
- John Kelsey, Bruce Schneier, and David Wagner. Related-key cryptanalysis of 3-WAY, Biham-DES, CAST, DES-X NewDES, RC2, and TEA. Lecture Notes in Computer Science, 1334: pp233–246, 1997.
- Julio César Hernández, Pedro Isasi, and Arturo Ribagorda. An application of genetic algorithms to the cryptoanalysis of one round TEA. Proceedings of the 2002 Symposium on Artificial Intelligence and its Application, 2002.
- Julio César Hernández, José María Sierra, Pedro Isasi, and Arturo Ribargorda. Finding efficient distinguishers for cryptographic mappings, with an application to the block cipher TEA. In Proceedings of the 2003 Congress on Evolutionary Computation, 2003.
- Julio César Hernández, José María Sierra, Arturo Ribagorda, Benjamín Ramos, and J. C. Mex-Perera. Distinguishing TEA from a random permutation: Reduced round versions of TEA do not have the SAC or do not generate random numbers. In Proceedings of the IMA Int. Conf. on Cryptography and Coding 2001, pages 374-377, 2001.
- Dukjae Moon, Kyungdeok Hwang, Wonil Lee, Sangjin Lee, and Jongin Lim. Impossible differential cryptanalysis of reduced round XTEA and TEA. Lecture Notes in Computer Science, 2365: 49-60, 2002. ISSN 0302-9743.
- Seokhie Hong, Deukjo Hong, Youngdai Ko, Donghoon Chang, Wonil Lee, and Sangjin Lee. Differential cryptanalysis of TEA and XTEA. In Proceedings of ICISC 2003, 2003b.
External links
- A web page advocating TEA and providing a variety of implementations (http://www.simonshepherd.supanet.com/tea.htm)
- Test vectors for TEA (http://www.cix.co.uk/~klockstone/teavect.htm)
- A survey of TEA and XTEA and their cryptanalysis (http://www-users.cs.york.ac.uk/~matthew/TEA/TEA.html)
- JavaScript implementation of TEA (http://www.movable-type.co.uk/scripts/TEAblock.html)
Block ciphers edit (https://academickids.com:443/encyclopedia/index.php?title=Template:Block_ciphers&action=edit) |
Algorithms: 3-Way | AES | Akelarre | Blowfish | Camellia | CAST-128 | CAST-256 | CMEA | DEAL | DES | DES-X | FEAL | FOX | FROG | G-DES | GOST | ICE | IDEA | Iraqi | KASUMI | KHAZAD | Khufu and Khafre | LOKI89/91 | LOKI97 | Lucifer | MacGuffin | Madryga | MAGENTA | MARS | MISTY1 | MMB | NewDES | RC2 | RC5 | RC6 | REDOC | Red Pike | S-1 | SAFER | SEED | Serpent | SHACAL | SHARK | Skipjack | Square | TEA | Triple DES | Twofish | XTEA |
Design: Feistel network | Key schedule | Product cipher | S-box | SPN Attacks: Brute force | Linear / Differential cryptanalysis | Mod n | XSL Standardisation: AES process | CRYPTREC | NESSIE Misc: Avalanche effect | Block size | IV | Key size | Modes of operation | Piling-up lemma | Weak key |