Tiny Encryption Algorithm

From Free net encyclopedia

This article is about the TEA encryption algorithm. For other meanings, see TEA (disambiguation).
TEA
Image:TEA.png
Two Feistel rounds (one "cycle") of TEA
General
Designer(s) Roger Needham and David Wheeler
First published 1994
Derived from -
Cipher(s) based on this design XTEA
Algorithm detail
Block size(s) 64 bits
Key size(s) 128 bits
Structure Feistel network
Number of rounds variable; recommended 64 Feistel rounds; 32 "cycles"
Best cryptanalysis
TEA suffers from equivalent keys (Kelsey et al, 1996) and can be broken using a related-key attack requiring 223 chosen plaintexts and a time complexity of 232 (Kelsey et al, 1997).

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. Vikram Reddy Andem presented a comprehensive study of TEA and cryptanalysis of the TEA (see below).

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, and Vikram Andem, 2003). 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 in C, 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.
  • Vikram Reddy Andem. A Cryptanalysis of the Tiny Encryption Algorithm, Masters thesis, The University of Alabama, Tuscaloosa, 2003.
  • 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

es:Tiny Encryption Algorithm fr:Tiny Encryption Algorithm


Block ciphers edit
Algorithms: 3-Way | AES | Akelarre | Anubis | Blowfish | Camellia | CAST-128 | CAST-256 | CMEA | CS-Cipher | DEAL | DES | DES-X | FEAL | FOX | FROG | G-DES | GOST | ICE | IDEA | Iraqi | KASUMI | KHAZAD | Khufu and Khafre | Libelle | LOKI89/91 | LOKI97 | Lucifer | MacGuffin | Madryga | MAGENTA | MARS | MISTY1 | MMB | NewDES | Noekeon | RC2 | RC5 | RC6 | REDOC | Red Pike | S-1 | SAFER | SEED | Serpent | SHACAL | SHARK | Skipjack | SMS4 | Square | TEA | Triple DES | Twofish | XTEA
Design: Feistel network | Key schedule | Product cipher | S-box | SPN   Attacks: Brute force | Linear / Differential cryptanalysis | Mod n | Related key | XSL   Standardization: AES process | CRYPTREC | NESSIE   Misc: Avalanche effect | Block size | IV | Key size | Modes of operation | Piling-up lemma | Weak key