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.
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:
The changes from the reference source code are minor:
unsigned long
type rather than the 64-bit clean uint32_t
.const
types.v1 +=
Love is like oxygen
You get too much you get too high
Not enough and you're gonna die
Love gets you high
Love is like oxygen
. . .
Time on my side
I got it all
I've heard that pride
Always comes before a fall
There's a rumour goin' round the town
That you don't want me around
I can't shake off my city blues
Every way I turn I lose
Love is like oxygen
. . .
Love is like oxygen
. . .
Time is no healer
If you're not there
Lonely fever
Sad words in the air
Some things are better left unsaid
I'm gonna spend my days in bed
I'll walk the streets at night
To be hidden by the city lights
City lights
Love is like oxygen
. . .
Love is like oxygen