3DES (3Data Encryption Standard)
Triple DES
Triple DES was developed to address the obvious flaws in DES without designing a whole new
cryptosystem. Triple DES simply extends the key size of DES by applying the algorithm three times in succession with three different keys. The combined key size is thus 168 bits (3 times 56), beyond the reach of brute-force techniques such as those used by the EFF DES Cracker. Triple DES has always been regarded with some suspicion, since the original algorithm was never designed to be used in this way, but no serious flaws have been uncovered in its design, and it is today available cryptosystem used in a number of Internet
protocols.
3DES is a trick to reuse DES implementations, by cascading three instances of DES (with distinct keys). 3DES is believed to be secure up to at least "2112" security (which is quite a lot, and quite far in the realm of "not breakable with today's technology"). But it is slow, especially in software (DES was designed for efficient hardware implementation, but it sucks in software; and 3DES sucks three times as much).
Triple DES extends the key length of DES by applying three DES operations on each block: an encryption with key 0, a decryption with key 1 and an encryption with key 2. These keys may be related.
Triple DES Algorithm
Triple DES is another mode of DES operation. It takes three 64-bit keys, for an overall key length of 192 bits. In Stealth, you simply type in the entire 192-bit (24 character) key rather than entering each of the three keys individually. The Triple DES DLL then breaks the user-provided key into three subkeys, padding the keys if necessary so they are each 64 bits long. The procedure for encryption is exactly the same as regular DES, but it is repeated three times, hence the name Triple DES. The data is encrypted with the first key, decrypted with the second key, and finally encrypted again with the third key.
Triple DES runs three times slower than DES, but is much more secure if used properly. The procedure for decrypting something is the same as the procedure for encryption, except it is executed in reverse. Like DES, data is encrypted and decrypted in 64-bit chunks. Although the input key for DES is 64 bits long, the actual key used by DES is only 56 bits in length. The least significant (right-most) bit in each byte is a parity bit, and should be set so that there are always an odd number of 1s in every byte. These parity bits are ignored, so only the seven most significant bits of each byte are used, resulting in a key length of 56 bits. This means that the effective key strength for Triple DES is actually 168 bits because each of the three keys contains 8 parity bits that are not used during the encryption process.
Select a TripleDES key so that it effectively behaves as regular DES
Triple-DES (aka "3DES") is three DES instances in due sequence. The "middle" DES instance is used in decryption mode, precisely so that an engine which implements 3DES can also execute plain DES. If you name the three successive keys K1, K2 and K3, then, when K1 = K2, the two first DES instances cancel each other (the second DES being in decryption mode, it reverses what the first DES did), so this is equivalent to simple DES with key K3. Similarly, if K2 = K3, this is equivalent to simple DES with key K1.
3DES nominally uses a 192-bit key (three 64-bit DES keys), out of which 168 bits are really used. Yet, there is an "academic" attack against 3DES with cost 2112, so it is often said that the overall security of 3DES is similar to that offered by a theoretically perfect block cipher with a 112-bit key. Hence, there is a widespread usage mode of 3DES in which we use a 128-bit key: 64 bits for K1 and 64 bits for K2, and then set K3 = K1. In plain words, encrypt the block with K1, then decrypt with K2, then encrypt again with K1. This seems sufficient to achieve the 112-bit level of security (of the 128 key bits, only 112 are really used), and the academic attack shows that you cannot go beyond that level anyway (112 bits are already quite far beyond what is technologically breakable right now, so no worry)(Edit: D.W. points out that there is a better attack, provided that you can harvest quite a few plaintext/ciphertext pairs; still, the attack cost is still too high to be used in practice). This is what your smartcard implements.
Note that there are protocols which use 3DES and really require the full 192-bit key, and cannot work with an implementation which only supports 128-bit keys; a prime example is SSL.
COMPARISON BETWEEN AES, 3DES AND DES.
Advance Encryption Standard (AES) and Triple DES (TDES or 3DES) are commonly used block ciphers.
Whether you choose AES or 3DES depend on your needs. In this section it would like to highlight their
differences in terms of security and performance (Seleborg, 2004).Since 3DES is based on DES algorithm, it will talk about DES first. DES was developed in 1977 and it was carefully designed to work better in hardware than software. DES performs lots of bit manipulation in substitution and permutation boxes in each of 16 rounds. For example, switching bit 30 with 16 is much simpler in hardware than software. DES encrypts data in 64 bit block size and uses effectively a 56 bit key. 56 bit key space amounts to approximately 72 quadrillion possibilities. Even though it seems large but according to today’s computing power it is not sufficient and vulnerable to brute force attack. Therefore, DES could not keep up with advancement in technology and it is no longer appropriate for security. Because DES was widely used at that time, the quick solution was to introduce 3DES which is secure enough for most purposes today.3DES is a construction of applying DES three times in sequence. 3DES with three different keys (K1,K2 and K3) has effective key length is 168 bits (The use of three distinct key is recommended of 3DES.). Another variation is called two-key (K1 and K3 is same) 3DES reduces the effective key size to 112 bits which is less secure. Two-key 3DES is widely used in electronic payments industry. 3DES takes three times as much CPU power than compare with its predecessor which is significant performance hit. AES outperforms 3DES both in software and in hardware [12],[13].The Rijndael algorithm has been selected as the Advance Encryption Standard (AES) to replace 3DES. AES is modified version of Rijndael algorithm.Advance
Security comparsion of 3DES and AES
Neither 3DES or AES is breakable with current technology (and foreseeable technology as well). However, you may encounter some security issues with 3DES if you encrypt more than about 32 gigabytes of data with a single key, whereas the limit is much higher with AES (this is due to the block size; 3DES uses 64-bit blocks, which can lead to trouble after processing 264/2 blocks, i.e. 32 gigabytes; AES uses 128-bit blocks, for a limit of 2128/2 blocks, i.e. 268 bytes, also known as "quite a lot of data").
Since AES is also noticeably faster than 3DES, there is little reason to use 3DES for new designs.
Brute-Force Attacks on 3DES
Recall that for DES there are 2^56 possible keys, and that a brute- force attack consists of trying each key until the right one is found. Since we are equally likely to find the key on the first, second, or even last try, on average we expect to find the key after trying half (2^55) of the keys, or after 36,028,797,018,963,968
decryptions. This doesn't seem completely impossible given current processor speeds, and as we saw above, we can expect with today's technology that such an attack could almost certainly be carried out in around half a day.
For a brute-force attack on 3DES, however, the outlook is far less optimistic. Consider the problem: we know C (and possibly p), and we are trying to guess k1, k2, and k3 in the following relation:
C = E_k3(D_k2(E_k1(p)))
In order to guess the keys, we must execute something like the following (assuming k1, k2, and k3 are 64-bit values, as are Ci and p):
for ( k3 = 0 to 2^56 step 1 )
compute C2 = D_k3(C1)
for ( k2 = 0 to 2^56 step 1 )
compute C3 = E_k2(C2)
for ( k1 = 0 to 2^56 step 1 )
begin
compute p = D_k1(C3) xor IV
if ( p equals p-expected )
exit loop; we found the keys
end
Note that in the worst case the correct key combination will be the last one we try, meaning we will have tried 2^168 crypto operations. If we assume that each 3DES decryption (2 decryptions plus one encryption) takes a single microsecond, this would amount to 1.19 x 10^37 years. That's FAR longer than scientists currently estimate our universe to have been in existence.
While it is important to note that we could slightly prune the key space by assuming that two equal keys would never be used (i.e., k1 != k2, k2 != k3, k1 != k3), this does not result in a significant work reduction when you consider the magnitude of the numbers we're dealing with. And what if we instead assumed that technological advances allow us to apply DES far more quickly?
Today, commercial 3DES chips capable of 10-Gbps encryption are widely available, and this translates to 15,625,000 DES blocks per second. The estimate given above assumed 1,000,000 DES blocks/second, so
10-Gbps hardware is 15 times as fast. This means in the worst caseit would take 7.6 x 10^35 years -- not much faster in the largercheme of things.
Even if we consider hardware that is 1,000,000 times faster, this would still require 7.6 x 10^29 years - still FAR longer than the universe has been around. Obviously, we're getting nowhere fast here. 3DES, for all practical purposes, is probably safe from brute-force attacks for the foreseeable future.
3DES Block Size
While the effective key length for 3DES is clearly much larger tha