Misplaced Pages

XTEA

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Block cipher

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (September 2015) (Learn how and when to remove this message)
XTEA
Two Feistel rounds (one cycle) of XTEA
General
DesignersRoger Needham, David Wheeler
First published1997
Derived fromTEA
SuccessorsCorrected Block TEA
Cipher detail
Key sizes128 bits
Block sizes64 bits
StructureFeistel cipher
Roundsvariable; recommended 64 Feistel rounds (32 cycles)
Best public cryptanalysis
A related-key rectangle attack on 36 rounds of XTEA (Lu, 2009)

In cryptography, XTEA (eXtended TEA) is a block cipher designed to correct weaknesses in TEA. The cipher's designers were David Wheeler and Roger Needham of the Cambridge Computer Laboratory, and the algorithm was presented in an unpublished technical report in 1997 (Needham and Wheeler, 1997). It is not subject to any patents.

Like TEA, XTEA is a 64-bit block Feistel cipher with a 128-bit key and a suggested 64 rounds. Several differences from TEA are apparent, including a somewhat more complex key-schedule and a rearrangement of the shifts, XORs, and additions.

Implementations

This standard C source code, adapted from the reference code released into the public domain by David Wheeler and Roger Needham, encrypts and decrypts using XTEA:

#include <stdint.h>
/* take 64 bits of data in v and v and 128 bits of key - key */
void encipher(unsigned int num_rounds, uint32_t v, uint32_t const key) {
    unsigned int i;
    uint32_t v0=v, v1=v, sum=0, delta=0x9E3779B9;
    for (i=0; i < num_rounds; i++) {
        v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key);
        sum += delta;
        v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key);
    }
    v=v0; v=v1;
}
void decipher(unsigned int num_rounds, uint32_t v, uint32_t const key) {
    unsigned int i;
    uint32_t v0=v, v1=v, delta=0x9E3779B9, sum=delta*num_rounds;
    for (i=0; i < num_rounds; i++) {
        v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + key);
        sum -= delta;
        v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key);
    }
    v=v0; v=v1;
}

The changes from the reference source code are minor:

  • The reference source code used the unsigned long type rather than the 64-bit clean uint32_t.
  • The reference source code did not use const types.
  • The reference source code omitted redundant parentheses, using C precedence to write the round function as e.g. v1 += (v0<<4 ^ v0>>5) + v0 ^ sum + k;

The recommended value for the "num_rounds" parameter is 32, not 64, as each iteration of the loop does two Feistel-cipher rounds. To additionally improve speed, the loop can be unrolled by pre-computing the values of sum+key.

Cryptanalysis

See also: cryptanalysis

In 2004, Ko et al. presented a related-key differential attack on 27 out of 64 rounds of XTEA, requiring 2 chosen plaintexts and a time complexity of 2.

In 2009, Lu presented a related-key rectangle attack on 36 rounds of XTEA, breaking more rounds than any previously published cryptanalytic results for XTEA. The paper presents two attacks, one without and with a weak key assumption, which corresponds to 2 bytes of data and 2 operations, and 2 bytes of data and 2 operations respectively.

Block TEA

Presented along with XTEA was a variable-width block cipher termed Block TEA, which uses the XTEA round function, but Block TEA applies it cyclically across an entire message for several iterations. Because it operates on the entire message, Block TEA has the property that it does not need a mode of operation. An attack on the full Block TEA was described by Saarinen, which also details a weakness in Block TEA's successor, XXTEA.

See also

  • Ascon — A NIST-select lightweight authenticated cipher.
  • RC4 — A stream cipher that, just like XTEA, is designed to be very simple to implement.
  • TEA — Block TEA's precursor.
  • XXTEA — Block TEA's successor.

References

  1. Roger M. Needham; David J. Wheeler (October 1997). Tea extensions (PDF). Computer Laboratory, University of Cambridge (Technical report).
  2. Ko, Youngdai; Hong, Seokhie; Lee, Wonil; Lee, Sangjin; Kang, Ju-Sung (2004). "Related Key Differential Attacks on 27 Rounds of XTEA and Full-Round GOST" (PDF). In Roy, B.; Meier, W. (eds.). Fast Software Encryption. FSE 2004. Lecture Notes in Computer Science. Vol. 3017. Berlin, Heidelberg: Springer. pp. 299–316. doi:10.1007/978-3-540-25937-4_19. ISBN 978-3-540-22171-5. Retrieved October 10, 2018.
  3. Hong, Seokhie; Hong, Deukjo; Ko, Youngdai; Chang, Donghoon; Lee, Wonil; Lee, Sangjin (2004). "Differential Cryptanalysis of TEA and XTEA". In Lim, JI.; Lee, DH. (eds.). Information Security and Cryptology. ICISC 2003. Lecture Notes in Computer Science. Vol. 2971. Berlin, Heidelberg: Springer. pp. 402–417. doi:10.1007/978-3-540-24691-6_30. ISBN 978-3-540-21376-5.
  4. Lu, Jiqiang (July 2, 2008). "Related-key rectangle attack on 36 rounds of the XTEA block cipher". International Journal of Information Security. 8 (1): 1–11. doi:10.1007/s10207-008-0059-9. ISSN 1615-5262. S2CID 26794956.
  5. Saarinen, Markku-Juhani (October 20, 1998). "Cryptanalysis of Block Tea". ResearchGate. Retrieved October 10, 2018.

Further reading

External links

Block ciphers (security summary)
Common
algorithms
Less common
algorithms
Other
algorithms
Design
Attack
(cryptanalysis)
Standardization
Utilization
Cryptography
General
Mathematics
Categories: