RTEA (from Ruptor's TEA or Repaired TEA ) - in cryptography, is a symmetric block crypto algorithm of the Feistel Network type, developed by Marcos el Ruptor, an extension of the TEA cipher algorithm. Fixed some vulnerabilities in the algorithm. Like other versions of the TEA algorithm, operations are based on working with 32-bit numbers. The algorithm is much simpler and more productive than XTEA , and, according to the authors and according to the statistical tests carried out by the developers, it is more resistant to cryptanalysis [1] . In order to withstand all adaptive and non-adaptive attacks, the algorithm needs the number of rounds equal to 32 + w * 4, where w is the number of 32-bit integers in the key, that is, 4 for the 128-bit key, and 8 for the 256-bit key. For a 128-bit key, 48 rounds are performed, for a 256-bit key, 64 rounds of the algorithm. [2]
| RTEA | |
|---|---|
![]() | |
| Creator | Marcos el Ruptor (Sean O'Neil) |
| Created by | 2007 year |
| Published | 2007 year |
| Key size | 128 (256) bits |
| Block size | 64 bit |
| Number of rounds | 48 (64) |
| Type of | Feistel Network |
Because it is a block cipher algorithm, where the block length is 64-bit, and the data length may not be a multiple of 64-bits, the values of all bytes complementing the block up to a frequency of 64-bits are set to 0x01.
Content
Implementation
The algorithm processes two 32-bit unsigned long numbers a and b in a single pass, i.e. a 64-bit block. The key length in 32-bit numbers is kw, r is a round.
Thus, the declaration of variables can be as follows:
u32 a , b , c , kw ;
u32 key [ kw ];
long r ;
Universal Code
// encryption
for ( r = 0 ; r < kw * 4 + 32 ; r ++ ) c = b , b + = a + (( b << 6 ) ^ ( b >> 8 )) + key [ r % kw ] + r , a = c ;
// decryption
for ( r = kw * 4 + 31 ; r ! = - 1 ; r - ) c = a , a = b - = a + (( a << 6 ) ^ ( a >> 8 )) + key [ r % kw ] + r , b = c ;
Which is similar to another spelling:
// encryption
for ( r = 0 ; r < kw * 4 + 32 ; r ++ ) a + = b + (( b << 6 ) ^ ( b >> 8 )) + key [ r % kw ] + r , r + + , b + = a + (( a << 6 ) ^ ( a >> 8 )) + key [ r % kw ] + r ;
// decryption
for ( r = kw * 4 + 31 ; r ! = - 1 ; r - ) b - = a + (( a << 6 ) ^ ( a >> 8 )) + key [ r % kw ] + r , r - , a - = b + (( b << 6 ) ^ ( b >> 8 )) + key [ r % kw ] + r ;
Code for 256-bit key
Using the algorithm is very simple and convenient. So, for a key equal to 256 bits (kw = 8), the code will be as follows:
// encryption
for ( r = 0 ; r < 64 ; r ++ )
{
b + = a + (( a << 6 ) ^ ( a >> 8 )) + ( key [ r % 8 ] + r );
r ++ ;
a + = b + (( b << 6 ) ^ ( b >> 8 )) + ( key [ r % 8 ] + r );
}
// decryption
for ( r = 63 ; r > = 0 ; r - )
{
a - = b + (( b << 6 ) ^ ( b >> 8 )) + ( key [ r % 8 ] + r );
r - ;
b - = a + (( a << 6 ) ^ ( a >> 8 )) + ( key [ r % 8 ] + r );
}
To ensure the uniqueness of each of the encrypted blocks with the identity of the original plaintext, one of the DES modes can be applied (for example, CBC, CFB, CTS, CTR)
Security
At the moment, there is only an attack based on related keys ( Eng. Related key attack ) [3] on this cipher.
See also
Tea
XTEA
XXTEA
Raiden - an algorithm, like RTEA, based on the ideas of the TEA block cipher
Notes
- ↑ Comparative stability results of symmetric cryptographic algorithms Archived July 25, 2008. (eng.)
- ↑ TEA, XTEA, XXTEA and RTEA Archived July 19, 2008.
- ↑ A related key attack for RTEA. (inaccessible link)
Links
- RTEA source code for Open Watcom C and Delphi
- FAQ on the materials of the conference fido7.ru.crypt. The following overwrite refers directly to RTEA: "To come up with an algorithm is 5% of the work. The remaining 95% is to make sure (and convince others) that no one can break it."
